I have a MultiBlocProvider
assigned for an app that has a Bottom Navigation Bar to navigate through main routes like Home, Search, Wishlist ...
I use setState(){}
to change the currentPage
for each route.
Recently I've added Blocs to each of them by using flutter_bloc
package and I'm using BlocProvider
to provide the bloc to each BlocBuilder
,
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
child: Scaffold(
key: _scaffoldKey,
body: PageStorage(
child: Stack(
children: <Widget>[
AnimatedSwitcher(
duration: Duration(milliseconds: 200),
child: BlocProvider<WishlistBloc>(
create: (BuildContext context) => WishlistBloc(WishlistRepository()),
child: currentPage),
),
bottomBar(currentPageScroll)
],
),
bucket: bucket,
),
),
);
}
Is it ok to use MultiBlocProvider
to provide all the BlocsProviders I need?
they could be more than 10 providers, would it affect the performance of the app?