import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'main.dart';
import 'preLogin.dart';

class Splash extends StatefulWidget {
  const Splash({key}) : super(key: key);
  @override
  _SplashState createState() => _SplashState();
}

class _SplashState extends State<Splash> {
  @override
  void initState() {
    super.initState();

    //SystemChrome.setEnabledSystemUIOverlays([]);
    Future.delayed(Duration(seconds: 1)).then((_) {
      Navigator.pushReplacement(
          context, MaterialPageRoute(builder: (context) => PreLogin()));
    });
  }



  double opacityLevel = 1.0;
  void _changeOpacity() {
    setState(() => opacityLevel = 1);
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: Center(
          child: Container(
        width: 400,
        child: AnimatedOpacity(
          opacity: opacityLevel,
          duration: Duration(seconds: 3),
          child: Image.asset("assets/images/Jubo_Splash.png"),
        ),
      )),
    );
  }
}
