假设在Flutter中,我在下面有一个页面屏幕堆栈。屏幕显示的是页面D,即最上面的页面。 Page D
Page C
Page B
Page A 如果我在D页上构建( Navigator.of(context).popUntil((route) => route.isFirst); ()方法的第一行),它将只弹出C页和B页。 我怎么也弹出页面A呢?
我正在尝试使用以下库:
名为animated_background
当我试图运行代码时,我发现了以下错误:
Compiler message:
lib/helpers/fade_route.dart:12:18: Error: The getter 'isInitialRoute' isn't defined for the class 'RouteSettings'.
- 'RouteSettings' is from 'package:flutter/src/widgets/navigator.dart' (
如何检查我的导航堆栈中是否有名为workout的路线?每当我调用popUntil并且路由不在我的堆栈中时,我就会得到:
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Navigator-[GlobalObjectKey<NavigatorState> _WidgetsAppState#9d229](dirty, state: NavigatorState#86712(tickers
我在构建navigationDrawer时遇到了错误,tootlip小部件需要materialApp作为祖先。
错误是这样说的:
I/flutter ( 5780): _TooltipState#bc79e(ticker inactive)):
I/flutter ( 5780): No Overlay widget found.
I/flutter ( 5780): Tooltip widgets require an Overlay widget ancestor for correct operation.
I/flutter ( 5780): The most common way t
Navigator.dart中有两个函数: removeRoute和removeRouteBelow。我不知道如何使用这两种方法。这是页面路由:/ -> A -> B -> C -> D。我在页面D中执行以下代码:
Navigator.removeRoute(context,builder(MaterialPageRoute:(context) => PushPageB();但是出了点问题:
══╡ EXCEPTION CAUGHT BY GESTURE ╞═════════════════════════════════
The following assert
我试着用路径从一个屏幕导航到另一个屏幕。当我按下按钮让页面移动到路由时,只要我得到错误
I/flutter ( 8790): Another exception was thrown: There are multiple heroes that share the same tag within a subtree.
下面是代码:
路线:
<String, WidgetBuilder>{
'/first':(BuildContext context) =>NavigatorOne() ,
'/second':(BuildCo
我有一个带有少量路由和onGenerateRoute回调的MateriallApp。当我在Navigator.pushNamed中推送一个无效的路由时,它抛出一个错误 Unhandled Exception: Could not find a generator for route RouteSettings("/path", null) in the _WidgetsAppState.
E/flutter ( 2342): Make sure your root app widget has provided a way to generate
E/flutter ( 23