0

I make a splash screen as the start screen of my app, when i debug the code on my phone it is run OK but it takes too longer time to display the splash screen

class _Splashstate extends State<Splash>{
  void navtologsignuppage(){
    Navigator.push(context, MaterialPageRoute(builder: (context){
      return LoginPage();
    }));
  }
  @override
  void initState() {
    super.initState();
    Timer(Duration(seconds: 3),navtologsignuppage);
  }
  @override
    Widget build(context) {
    return  Scaffold(
      body: Container(
      color: Colors.black,
      child: Stack(
        fit: StackFit.expand,
        children: <Widget>[
          Column(
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              SizedBox(height: 200,),
              CircleAvatar(
                radius: 40,
                backgroundColor: Colors.transparent,
                child: Image.asset('externalresources/images/SplashScreenicon.png',fit: BoxFit.cover,),
              ),

  • A few pieces of advice to you as a first time poster. Please correct grammatical errors in your post: "feaster" -> "faster", etc. – Alexander Ryzhov May 22 '19 at 19:41
  • Also, please understand that StackOverflow policy discourages questions related to solving a particular custom problem. The question has to be generic enough to be useful to others. With that in mind, please take time to generalize the question as much as possible and omit the details specific to your case. – Alexander Ryzhov May 22 '19 at 19:43

1 Answers1

1

You start the splash screen with your Flutter code, but you must wait until the Flutter Engine is ready before displaying your splash screen.

If you want a start screen that pops up immediately you can add a native one, please refer to this answer for more details.

Tristan Pct
  • 584
  • 5
  • 13