我拥有AuthBloc,而不是管理用户身份验证。当我想从LessonsScreen推送新页面时,为什么BlocBuilder会调用?我不知道如何解决。
@override
Widget build(BuildContext context) {
return MaterialApp(
home: BlocBuilder<AuthBloc, AuthState>(
builder: (context, state) {
if (state is AuthUninitialized) {
return SplashScreen();
}
if (state is AuthAuthenticated) {
Navigator.of(context).popUntil((route) => route.isFirst);
if (state.isRegistered) {
return LessonsScreen();
}
return EditProfileScreen();
}
if (state is AuthUnauthenticated) {
return LoginPhoneScreen();
}
return null;
},
),
);
}