Hi @mono0926 ๐
Nice to meet you and thank for useful library that helped me so much in work. ๐
But I have a concern and I dont know if it's a bug. For example, I have an app with 2 screens: Splash screen and Login screen.
When I define BlocProvider (LoginBloc
) for LoginScreen, I cannot define it inside LoginScreen, and I must define it in route
, otherwise Invalid arguments
error will be raised Invalid argument(s): LoginBloc is not provided to LoginScreen. Context used for Bloc retrieval must be a descendant of BlocProvider.
:
// success
(BuildContext context) => BlocProvider<LoginBloc>(
creator: (_, _bag) => LoginBloc(),
child: LoginScreen(),
// failed: inside LoginScreen
@override
Widget build(BuildContext context) {
return BlocProvider<LoginBloc>(
creator: (_, _bag) => LoginBloc(),
child: Scaffold(
primary: true,
appBar: EmptyAppBar(),
body: _buildBody(),
));
}
This is just a minor problem but I dont know if it can be fixed, thank you ๐