简体   繁体   English

未处理的异常:'package:flutter/src/widgets/navigator.dart':断言失败:第 3499 行 pos 12:'!_debugLocked':不正确。”FLUTTER

[英]Unhandled Exception: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 3499 pos 12: '!_debugLocked': is not true." FLUTTER

I work in flutter project, and i have a problem that : the project composed from three Pages (splash.dart, login.dart, dashboard.dart), when the app launch the splash.dart page opened, and i passe the new user to login.dart page, and when he put a valid credentials i passe he to dashboard.dart page but in this second passage i got the error below "[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 3499 pos 12: '!_debugLocked': is not true."我在flutter项目中工作,我有一个问题:该项目由三个页面(splash.dart、login.dart、dashboard.dart)组成,当应用程序启动splash.dart页面时,我通过了新用户到 login.dart 页面,当他输入有效凭据时,我将他传递给了dashboard.dart 页面,但在第二段中,我收到以下错误“[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] 未处理的异常:'package:flutter/src/widgets/navigator.dart':断言失败:第 3499 行 pos 12:'!_debugLocked':不正确。” Also when i want to display an alert to inform the user to put a valid credentials when he put invalid credentials a got the same problem thanks in advance,此外,当我想显示警报以通知用户输入无效凭据时,他会遇到同样的问题,请提前感谢,

The method you use for page redirection should look like this:您用于页面重定向的方法应如下所示:

Navigator.of(context).push(
        MaterialPageRoute(
          settings: RouteSettings(name: OtherPage.routeName),
          builder: (context) => OtherPage(),
        ),
      );

If this method doesn't fix your problem, be careful where you define it in the builder widget and make sure you don't use BuildContext in unnecessary places如果此方法不能解决您的问题,请注意在构建器小部件中定义它的位置,并确保不要在不必要的地方使用BuildContext

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 'package:flutter/src/widgets/navigator.dart':断言失败:第 5338 行 pos 12:':_debugLocked'。 不是真的。 这是我在下面给出的代码 - 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 5338 pos 12: '!_debugLocked': is not true. And this is my Code given Below 错误:_AssertionError('package:flutter/src/widgets/navigator.dart':断言失败:第 4893 行 pos 12:':_debugLocked'。不是真的。) - Error: _AssertionError ('package:flutter/src/widgets/navigator.dart': Failed assertion: line 4893 pos 12: '!_debugLocked': is not true.) 抛出另一个异常:'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2216 pos 12: ':_debugLocked': is not true - Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2216 pos 12: '!_debugLocked': is not true 引发了另一个异常:'package:flutter/src/widgets/navigator.dart':断言失败:第 3803 行 pos 12:'_history.isNotEmpty':不正确 - Another exception was thrown: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 3803 pos 12: '_history.isNotEmpty': is not true 'package:flutter/src/widgets/navigator.dart':断言失败:第 5140 行 pos 12:'_history.isNotEmpty':不正确 - 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 5140 pos 12: '_history.isNotEmpty': is not true Flutter - _AssertionError('package:flutter/src/widgets/framework.dart':断言失败:第 4937 行 pos 12:'child == _child':不正确。) - Flutter - _AssertionError ('package:flutter/src/widgets/framework.dart': Failed assertion: line 4937 pos 12: 'child == _child': is not true.) Error Flutter:未处理的异常:'package:provider/src/provider.dart':断言失败:第 240 行 pos 12:'context:= null':不正确 - Flutter: Unhandled Exception: 'package:provider/src/provider.dart': Failed assertion: line 240 pos 12: 'context != null': is not true 'package:flutter/src/widgets/will_pop_scope.dart':断言失败:第 61 行 pos 12:'_route == ModalRoute.of(context)':不正确 - 'package:flutter/src/widgets/will_pop_scope.dart': Failed assertion: line 61 pos 12: '_route == ModalRoute.of(context)': is not true 小部件库“package:flutter/src/widgets/sliver.dart”捕获的异常:断言失败:第 543 行 pos 15:“children != null”:不正确 - Exception caught by widgets library 'package:flutter/src/widgets/sliver.dart': Failed assertion: line 543 pos 15: 'children != null': is not true 错误:'package:flutter/src/widgets/media_query.dart':断言失败:第 715 行 pos 12:'context:= null':不正确 - Error : 'package:flutter/src/widgets/media_query.dart': Failed assertion: line 715 pos 12: 'context != null': is not true
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM