Open flutter dialog after navigation

后端 未结 3 1230

I call Navigator pushReplacement to show a new view within my flutter app and want to immediately pop up a simple dialog to introduce the page to the user. (I want the user

3条回答
  •  春和景丽
    2020-12-29 04:49

    Another way of doing it is using Timer.run(...)

    @override
    void initState() {
      super.initState();
    
      // simply use this
      Timer.run(() {
        showDialog(
          context: context,
          builder: (_) => AlertDialog(title: Text("Dialog title")),
        );
      });
    }
    

提交回复
热议问题