Flutter, passing parameters to PageRoutebuilder

后端 未结 2 1849
情书的邮戳
情书的邮戳 2021-01-28 06:04

In Method gotoThirdScreen(), I am tryiing to pass parameters to a class. I believe the issue starts at: //========================================================= //===

2条回答
  •  无人及你
    2021-01-28 06:58

    Pass title value to SecondPage constructor:

    void _gotoThirdPage() {
      String page_title = "Yet Another Page";
    
      final pageRoute = new PageRouteBuilder(
        pageBuilder: (BuildContext context, Animation animation,
            Animation secondaryAnimation) {
          return new SecondPage(title: page_title);
        },
    

提交回复
热议问题