Flutter hold splash screen for 3 Seconds. How to implement splash screen in Flutter?

前端 未结 9 2192
后悔当初
后悔当初 2021-02-16 00:16

How to show splash screen in flutter for 3 seconds and then go next my login screen.

I have tried.countdowntimer but import is unresolved

import \'pack         


        
9条回答
  •  萌比男神i
    2021-02-16 00:45

    I think you need to clear the old activity from stack (Splash Screen), So you have to use pushNamedAndRemoveUntil instead of using pushNamed only.

      new Future.delayed(const Duration(seconds: 3), () {
      Navigator.pushNamedAndRemoveUntil(context, '/login', ModalRoute.withName('/'));
    });
    

提交回复
热议问题