【问题标题】:How can i pass data to the pervious page using WillPopScope如何使用 WillPopScope 将数据传递到上一页
【发布时间】:2021-08-15 17:30:59
【问题描述】:

颤振飞镖

我需要将数据传递到上一页,我不知道我该如何处理,任何帮助将不胜感激,谢谢

 WillPopScope(
            onWillPop: () async{


             
              Navigator.pop(context, false );
              
              return Future.value(false);
            },

【问题讨论】:

标签: dataframe flutter dart scope zip


【解决方案1】:

在第一个屏幕中尝试此代码 push:

   var res = await Navigator.push(
      context,
      MaterialPageRoute<bool>(
        builder: (BuildContext context) => const SecondScreen(),
      ),
    );
    
    print(res.toString());

   

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-24
    • 1970-01-01
    • 2015-02-18
    • 2021-12-04
    • 1970-01-01
    • 1970-01-01
    • 2020-07-08
    相关资源
    最近更新 更多