美文网首页Flutter 知识点整理
flutter 里面实现页面跳转功能

flutter 里面实现页面跳转功能

作者: 跨界师 | 来源:发表于2021-07-04 01:09 被阅读0次

在页面里面是跳转,可以使用Navicator方法,比如从主页跳转到搜索页面:

Navigator.of(context).push(MaterialPageRoute(builder: (context) => Search()));

另外,还可以携带参数传递:

Navigator.of(context).push(MaterialPageRoute(builder: (context) => FormPage(title: "hahah")));

对应接受参数:
String title;
  FormPage({
    Key? key,
    this.title = "表单",
  }) : super(key: key);
需要有构造函数

相关文章

网友评论

    本文标题:flutter 里面实现页面跳转功能

    本文链接:https://www.haomeiwen.com/subject/ukqmultx.html