import 'package:flutter/material.dart';
import 'package:rkm_educa_app/telas/tela_login.dart';
import 'package:rkm_educa_app/utils/cores.dart';
import '../servicos/shared_preferences/shared.dart';
import '../utils/dimensoes.dart';

class TelaSplash extends StatefulWidget {
  const TelaSplash({Key? key}) : super(key: key);

  @override
  State<TelaSplash> createState() => _TelaSplashState();
}

class _TelaSplashState extends State<TelaSplash> {

  carregar()async{
    Future.delayed(Duration(seconds: 3),(){
      Navigator.pushReplacement(context, MaterialPageRoute(builder: (context)=>TelaLogin()));
    });
  }

  @override
  void initState() {
    super.initState();
    carregar();
  }

  @override
  Widget build(BuildContext context) {
    Dimensoes().init(context);
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Container(
                child: Image.asset("assets/images/logoEduca.png",width:Dimensoes.width * 0.4,height: Dimensoes.height * 0.15)
            ),
            CircularProgressIndicator(color: PaletaCores.cinzaClaro,)
          ],
        ),
      ),
    );
  }
}
