Flutter Navigator operation requested with a context that does not include a Navigat
如下直接在 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的更多相关文章
- 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 ...
- 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 ...
- System.TimeoutException: The operation requested on PersistentChannel timed out
这个异常是在使用EasyNetQ时,遇到的问题,找了两个小时. 详细错误 Error:System.TimeoutException: The operation requested on Persi ...
- ABP .Net Core 调用异步方法抛异常A second operation started on this context before a previous asynchronous operation completed
1. 问题描述 最近使用ABP .Net Core框架做一个微信开发,同时采用了一个微信开发框架集成到ABP,在微信用户关注的推送事件里调用了一个async 方法,由于没有返回值,也没做任何处理,本 ...
- Flutter Navigator&Router(导航与路由)
参考地址:https://www.jianshu.com/p/b9d6ec92926f 在我们Flutter中,页面之间的跳转与数据传递使用的是Navigator.push和Navigator.pop ...
- Flutter Navigator 跳转
1,routes 静注册,使用 跳转 Navigator.pushNamed(context, "/main"); 2,静态跳转及销毁当前页面使用 Navigator.pushNa ...
- flutter Failed to setup Skia Gr context导致白屏
添加 --enable-software-rendering参数运行 G:\soft\flutter\project\hello_world> flutter run --enable-soft ...
- Entity Framework Core: A second operation started on this context before a previous operation completed
我这边报错是因为函数声明的是async void 而实现中有多个task任务,导致的线程不安全
- 【Flutter学习】一些重要的概念之of(context)方法
在flutter中我们经常会使用到这样的代码 //打开一个新的页面 Navigator.of(context).push //打开Scaffold的Drawer Scaffold.of(context ...
随机推荐
- spring.net事件的注入
.c#代码 TestObject source = new TestObject(); TestEventHandler eventListener1 = new TestEventHandler() ...
- LWIP内存管理
LWIP是一种TCP/IP协议栈,与嵌入式操作系统一样也提供了内存管理. 内存池里面有多个同样大小的内存,不同类型的内存池其里面的内存大小不一样.
- jQuar总结10:jQuery操作元素的属性
jQuery操作元素的属性 1 设置单个属性 //html <div></div> //js $('div').attr('id', 'box'); $('div').attr ...
- Introduction mybatis
项目地址 https://github.com/mybatis/mybatis-3 英文官网 http://mybatis.github.io/mybatis-3/ 中文官网 http://mybat ...
- 执行“hdfs dfs -ls”时报ConnectException
原因可能是指定的端口号不对,该端口号由hdfs-site.xml中的属性"dfs.namenode.rpc-address"指定,即为NameNode的RPC服务端口号. 文件上传 ...
- Eclipse 调试 NodeJS
插件地址 http://chromedevtools.googlecode.com/svn/update/dev/ 博客地址 http://www.cnblogs.com/QLeelulu/arc ...
- Linux删除(清空)正在运行的应用日志文件内容
在测试环境定位问题时,如果发现日志文件内容太多或太大,有时需要删除该日志,如Tomcat,Nginx日志.以前每次都是先rm -rf ***.log,然后重启应用.直到后来发现了以下命令,原来可以不用 ...
- VC++中GDI和GDI+ 的坐标系统介绍
在Windows应用程序中,只要进行绘图,就要使用GDI坐标系统.Windows提供了几种映射方式,每一种映射都对应着一种坐标系.例如,绘制图形时,必须给出图形各个点在客户区的位置,其位置用x 和y两 ...
- leetcode 加一
给定一个非负整数组成的非空数组,在该数的基础上加一,返回一个新的数组. 最高位数字存放在数组的首位, 数组中每个元素只存储一个数字. 你可以假设除了整数 0 之外,这个整数不会以零开头. 示例 1: ...
- Django Managers管理器
Managers class Manager 管理器是向Django模型提供数据库查询操作的接口.Django应用程序中每个模型至少有一个管理器. Manager names 默认情况下管理器的名字为 ...