From 823044c6ab7fcf46833928822dc24330867c4cbb Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Sat, 10 Jun 2023 16:27:04 +0200 Subject: [PATCH] neon: inject provider for all apps neon: make AppsBloc.getAppProviders a getter --- packages/neon/neon/lib/src/blocs/apps.dart | 5 ++--- packages/neon/neon/lib/src/pages/home.dart | 11 ++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/neon/neon/lib/src/blocs/apps.dart b/packages/neon/neon/lib/src/blocs/apps.dart index 5dceb6d8..fd06e320 100644 --- a/packages/neon/neon/lib/src/blocs/apps.dart +++ b/packages/neon/neon/lib/src/blocs/apps.dart @@ -145,7 +145,6 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates return _blocs[appImplementation.id] = appImplementation.buildBloc(_account.client) as T; } - List? getAppProviders() => appImplementations.valueOrNull?.data - ?.map((final appImplementation) => appImplementation.blocProvider(_account.client)) - .toList(); + List get appBlocProviders => + _allAppImplementations.map((final appImplementation) => appImplementation.blocProvider(_account.client)).toList(); } diff --git a/packages/neon/neon/lib/src/pages/home.dart b/packages/neon/neon/lib/src/pages/home.dart index b28f7688..444220a1 100644 --- a/packages/neon/neon/lib/src/pages/home.dart +++ b/packages/neon/neon/lib/src/pages/home.dart @@ -528,13 +528,10 @@ class _HomePageState extends State { ), ); - final appProviders = _appsBloc.getAppProviders(); - if (appProviders != null) { - body = MultiProvider( - providers: appProviders, - child: body, - ); - } + body = MultiProvider( + providers: _appsBloc.appBlocProviders, + child: body, + ); return WillPopScope( onWillPop: () async {