1,routes 静注册,使用 跳转

Navigator.pushNamed(context, "/main");

2,静态跳转及销毁当前页面使用

  Navigator.pushNamedAndRemoveUntil(context, "/main", (route) => route == null);

3,静态跳转销毁当前页面并跳转指向新的页面

  Navigator.popAndPushNamed(context, 'forgetPwdRoute');

4,动态注册跳转

  Navigator.push(context,

        new MaterialPageRoute(
builder: (BuildContext context) {
return new MainPage();
},
),
);

5,动态注册跳转并传参

Navigator.push<String>(
context,
new MaterialPageRoute(
builder: (BuildContext context) {
return new OtherPage(pwd: "123456");
},
),
);

6,动态注册跳转并销毁

Navigator.pushAndRemoveUntil(context,
new MaterialPageRoute(
builder: (BuildContext context) {
return new MainPage();
},
), (route) => route == null);

7,销毁当前页面 / 返回结果

Navigator.pop(context); // 销毁当前界面
Navigator.pop(context, ['a,b,c']); // 销毁当前界面,并返回字符串数组
Navigator.pop(context, '这是 HomePage 页'); // 销毁当前界面,并返回字符串

8,接收返回值

可以用 .then 或 await

 

Flutter Navigator 跳转的更多相关文章

  1. flutter routes跳转

    flutter可以通过push pop跳转到上一级或者下一级 基本push跳转方法 此时仍然有返回按钮 Navigator.push( context, MaterialPageRoute( buil ...

  2. 小程序navigator跳转路径url写法

    小程序navigator跳转路径url要写  要跳转的的页面文件夹相对于当前页面的页面文件夹的位置,即相对路径. 比如我当前页面跳转到同级目录下的另一个页面如下: <navigator url= ...

  3. Flutter路由跳转及参数传递

    本文要介绍的知识点 用路由推出一个新页面 打开新页面时,传入参数 参数的回传 路由 做Android/iOS原生开发的时候,要打开一个新的页面,你得知道你的目标页面对象,然后初始化一个Intent或者 ...

  4. flutter -------- 页面跳转和传值

    在安卓原生开发中,页面跳转可以用Intent类来具体实现: Intent intent =new Intent(MainActivity.this,second.class); startActivi ...

  5. Flutter页面跳转返回数据

    Dart中的异步请求和等待和ES6中的方法很像,直接使用async...await就可以实现. 核心代码: _navigateToAddress(BuildContext context) async ...

  6. Flutter Navigator&Router(导航与路由)

    参考地址:https://www.jianshu.com/p/b9d6ec92926f 在我们Flutter中,页面之间的跳转与数据传递使用的是Navigator.push和Navigator.pop ...

  7. Flutter路由跳转父级页面向子页面传参及子页面向父级页面传参

    Flutter中页面通过路由跳转传参主要分两种,一种是通过push()跳转时根据设定的参数进行传参,另一种是通过pop()返回时进行传参. 父级页面向子页面push()传参 假设从A页面跳到B页面可能 ...

  8. 微信小程序navigator跳转失效

    在编写小程序时遇到一个问题:使用 <navigator url='/pages/lists/index'>...</navigator>进行跳转没有反应.控制台也没有报错,ap ...

  9. Flutter Navigator operation requested with a context that does not include a Navigat

    如下直接在 MaterialApp 中使用 Navigator 是会报 Navigator operation requested with a context that does not inclu ...

随机推荐

  1. mongoTemplate查询

    1.精确查询用“is” Criteria criteria=new Criteria("namespaceName"); criteria.is(namespaceName); Q ...

  2. numpy.convolve()

    卷积函数: numpy.convolve(a, v, mode='full') Parameters: a : (N,) array_like First one-dimensional input ...

  3. Java 实现 WC.exe

    Github:https://github.com/YJOED/Code/tree/master/WC/src 一.题目:实现一个统计程序,它能正确统计程序文件中的字符数.单词数.行数,以及还具备其他 ...

  4. VS2010 solution中完美的相对路径引用方法

    假设您有一个工程叫solar,路径结构是这样的: 公用头路径: d:\solar\public\include公用库路径:d:\solar\public\libmars项目 : d:\solar\ma ...

  5. Linux基础--安装搭建tomcat+java+mysql

    一.安装jdk 1.可选安装yum -y install lrzsz方便传文件.(yum -y意思是所有的都选yes) yum update -y  更新yum镜像 yum list lrzsz* 列 ...

  6. Android-监听操作系统短信

    想要访问Android操作系统的ContentProvider就需要明白以下原理: 在Android操作系统里面的 /packsges/目录: apps: 很多的系统应用,例如:联系人,浏览器,音乐播 ...

  7. MySQL分页查询存储过程

    -- 分页查询delimiter $create procedure p_List(in i_Name varchar(50),in i_CName varchar(20),in pageIndex ...

  8. 小程序:如何在wxml页面中调用JavaScript函数

    早上过来遇到一个这样的bug: 在计算百分比的时候没有保留小数点后2位,从而导致一些无法整除的结果显示太长 一开始,我以为这是一个很普通的bug,既然wxml在页面{{}}内支持简单的运算,我想也应该 ...

  9. windbg符号路径设置

    .sympath C:\Users\leoyin\Desktop\last;SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols  

  10. join()函数

    注意:会报错 正确的: