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

修改为如下所示,将要使用路由的部分嵌套一层即可正常使用。

总结:要使用 路由(Navigator),根控件不能直接是 MaterialApp.

解决方法:将 MaterialApp 内容再使用 StatelessWeight 或 StatefulWeight 包裹一层。

Flutter Navigator operation requested with a context that does not include a Navigat的更多相关文章

  1. flutter dialog异常Another exception was thrown: Navigator operation requested with a context that does not include a Navigator

    我在使用flutter里的对话框控件的时候遇到了一个奇怪的错误 Another exception was thrown: Navigator operation requested with a c ...

  2. flutter: Another exception was thrown: Navigator operation requested with a context that does not include a Navigator.

    import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends State ...

  3. System.TimeoutException: The operation requested on PersistentChannel timed out

    这个异常是在使用EasyNetQ时,遇到的问题,找了两个小时. 详细错误 Error:System.TimeoutException: The operation requested on Persi ...

  4. ABP .Net Core 调用异步方法抛异常A second operation started on this context before a previous asynchronous operation completed

    1.  问题描述 最近使用ABP .Net Core框架做一个微信开发,同时采用了一个微信开发框架集成到ABP,在微信用户关注的推送事件里调用了一个async 方法,由于没有返回值,也没做任何处理,本 ...

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

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

  6. Flutter Navigator 跳转

    1,routes 静注册,使用 跳转 Navigator.pushNamed(context, "/main"); 2,静态跳转及销毁当前页面使用 Navigator.pushNa ...

  7. flutter Failed to setup Skia Gr context导致白屏

    添加 --enable-software-rendering参数运行 G:\soft\flutter\project\hello_world> flutter run --enable-soft ...

  8. Entity Framework Core: A second operation started on this context before a previous operation completed

    我这边报错是因为函数声明的是async  void 而实现中有多个task任务,导致的线程不安全

  9. 【Flutter学习】一些重要的概念之of(context)方法

    在flutter中我们经常会使用到这样的代码 //打开一个新的页面 Navigator.of(context).push //打开Scaffold的Drawer Scaffold.of(context ...

随机推荐

  1. spark读写Sequoiadb

    spark如何读写Sequoiadb,最近被客户问多了,这个记录下. Spark读Sequoiadb数据: package marketing import com.sequoiadb.hadoop. ...

  2. 哈代平衡 &连锁不平衡

    哈代-温伯格平衡定律(Hardy-Weinberg equilibrium),即HW平衡,是指对于一个大且随机交配的种群,基因频率和基因型频率在没有迁移.突变和选择的条件下会保持不变. 它是建立在一个 ...

  3. mysql元数据查询

    截图来自<深入浅出MySQL++数据库开发.优化与管理维护+第2版+唐汉明>一书

  4. NetBeans找不到C/C++编译器

    如果您已经安装 NetBeans IDE 6.9,但其中不包括 C/C++ 插件 如果在选择“文件”>“新建项目”时,NetBeans IDE 未显示 "C/C++" 项目类 ...

  5. spark安装配置(scala不是必须的,基于java虚拟机,因此scala可以不配,但是开发需要可以配)

    下载 http://spark.apache.org/downloads.html 下载2.3.1 https://blog.csdn.net/qq_15349687/article/details/ ...

  6. 一篇文章让你快速入门 学懂Shell脚本

    Shell脚本,就是利用Shell的命令解释的功能,对一个纯文本的文件进行解析,然后执行这些功能,也可以说Shell脚本就是一系列命令的集合. Shell可以直接使用在win/Unix/Linux上面 ...

  7. centos安装mysql,tomcat

    软件下载: jre和jdk下载:http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javas ...

  8. Java网络编程のTCP/IP

    TCP/IP参考模型和TCP/IP协议 与OSI参考模型相似,TCP/IP参考模型汲取了网络分层的思想,而且对网络的层次做了简化,并在网络各层都提供了完善的协议,这些协议构成了TCP/IP协议集,简称 ...

  9. C++对象在内存中的布局

    (1)C++对象模型 (2)单一继承无虚函数 (3)单一继承有虚函数 (4)多重继承 (5)虚拟继承(vc++) (6)虚拟继承(g++) 参考:<深度探索C++对象模型>

  10. 什么是C#?什么是.NET Framework?

    1.什么是C#: 解1:C#就是一门开发语言,是由C及C++演变而来的,有朋友戏称之为"C四个+",这里的"#"号,不读"井",而读做&qu ...