-
安卓通过
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
相关推荐
SoaringHeart1 天前
Flutter进阶:OverlayEntry 插入图层管理器 NOverlayZIndexManager程序员老刘1 天前
Flutter 3.44 有哪些变化?(官方blog完整翻译)山屿落星辰1 天前
Flutter 企业级架构设计实战:Clean Architecture + 分层模块化 + 依赖注入全解析山屿落星辰1 天前
Flutter 高级特性实战:动画、自定义绘制、平台通道与 Web 优化程序软件分享1 天前
2026旗舰版 Java+Flutter 期货微交易系统源码全开源多语言平台飞龙14775657467501 天前
Flutter 安全存储插件全面解析:从入门到进阶带带弟弟学爬虫__1 天前
dyAPP数据采集-个人主页、发布、搜索、评论icc_tips1 天前
Flutter runAppAsync() 详解:干净的异步应用启动恋猫de小郭1 天前
Android 发布全新性能分析器,实用性和性能大升级恋猫de小郭2 天前
Flutter 3.44 发布啦,超级大版本更新!!!