-
安卓通过
scheme调起未启动的APP,进入APP后会白屏一会然后报错:A GlobalKey was used multipletimes inside one widget'schild list.The offending GlobalKey was:[LabeledGlobalKey<Navigatorstate>#7a685 Key Created bydefault]The parent of the widgets withthat key was:FocusInheritedscopeThe first child to getinstantiated with that keybecame:Navigator-[LabeledGlobalKey<NavigatorState>#7a685 KeyCreated by default]The second child that was tobe instantiated with that keywas :FocusInheritedScopeA GlobalKey can only bespecified on one widget at atime in the widget tree.See also: https://docs,flutter.dev/testing/ -
原因就是使用的
initialRoute没有配置完全导致的dart/// MaterialApp Widget buildMaterialApp(BuildContext context) { return GetMaterialApp( title: '水哥自用框架', // ...更多配置 // 这是正常的配置,指定初始路由 initialRoute: widget.initialRoute, // 这是这是路由列表 getPages: appRoutes.getPages, // 注意:就是这没有配置导致的,找不到路由的情况需要指定一个路由,可以设置为初始化的路由,也可以设置为找不到页面的路由 // 配置好这个就不会报错了。 unknownRoute: GetPage(name: appRoutes.initialRoute, page: () => widget.initialRoutePage), ); }scheme为什么会出现找不到路由?例如:dzm://?id=123与dzm:///tabbar?id=123前者就会被认为没有指定页面,后者不会出现问题,会进入到/tabbar页面。也可以通过强制给
scheme解决问题,也可以通过配置好unknownRoute解决问题。
Flutter A GlobalKey was used multipletimes inside one widget'schild list.The ...
卡尔特斯2025-09-17 14:21
相关推荐
2401_839633913 分钟前
鸿蒙flutter第三方库适配 - 看板应用空中海1 小时前
5.1 HTTP 与网络请求提子拌饭1332 小时前
生命组学架构下的细胞分化与基因突变生存模拟器:基于鸿蒙Flutter的情景树渲染与状态溢出防御空中海4 小时前
6.1 主题与暗色模式你听得到114 小时前
周下载60w,但是作者删库!我从本地 pub 缓存里把它救出来,顺手备份到了自己的 GitHubSY.ZHOU5 小时前
移动端架构体系(五):终篇总结不爱吃糖的程序媛6 小时前
flutter build hap --release` 后版本号被改回 1.0.0weixin_443478516 小时前
Flutter 中Google 地图组件包 `google_maps_flutter麒麟ZHAO7 小时前
鸿蒙flutter第三方库适配 - 动态表单见山是山-见水是水8 小时前
鸿蒙flutter第三方库适配 - 页面转场应用