相关疑难解决方法(0)

Flutter-如何检查用户是否登录,如果显示,则显示其他屏幕?

我的第一个屏幕是登录屏幕,它需要检查用户是否已登录才能直接打开主屏幕,但是使用此检查却出现错误。

我正在检查initState,条件返回的是true,所以看起来问题出在导航器上。

如果用户已登录,跳过第一个屏幕的正确方法是什么?

错误:

I/flutter (20803): ??? EXCEPTION CAUGHT BY WIDGETS LIBRARY ????????????????????????????????????????????????????????????
I/flutter (20803): The following assertion was thrown building Navigator-[GlobalObjectKey<NavigatorState>
I/flutter (20803): _WidgetsAppState#8ce27](dirty, state: NavigatorState#db484(tickers: tracking 2 tickers)):
I/flutter (20803): 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2106 pos 12: '!_debugLocked':
I/flutter (20803): is not true.
I/flutter (20803): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter (20803): more information in this error message to help you determine and fix the underlying cause.
Run Code Online (Sandbox Code Playgroud)

码: …

dart firebase-authentication flutter

5
推荐指数
4
解决办法
3325
查看次数

标签 统计

dart ×1

firebase-authentication ×1

flutter ×1