Browse Source

neon: inject provider for all apps

neon: make AppsBloc.getAppProviders a getter
pull/371/head
Nikolas Rimikis 1 year ago
parent
commit
823044c6ab
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 5
      packages/neon/neon/lib/src/blocs/apps.dart
  2. 11
      packages/neon/neon/lib/src/pages/home.dart

5
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; return _blocs[appImplementation.id] = appImplementation.buildBloc(_account.client) as T;
} }
List<Provider>? getAppProviders() => appImplementations.valueOrNull?.data List<Provider> get appBlocProviders =>
?.map((final appImplementation) => appImplementation.blocProvider(_account.client)) _allAppImplementations.map((final appImplementation) => appImplementation.blocProvider(_account.client)).toList();
.toList();
} }

11
packages/neon/neon/lib/src/pages/home.dart

@ -528,13 +528,10 @@ class _HomePageState extends State<HomePage> {
), ),
); );
final appProviders = _appsBloc.getAppProviders(); body = MultiProvider(
if (appProviders != null) { providers: _appsBloc.appBlocProviders,
body = MultiProvider( child: body,
providers: appProviders, );
child: body,
);
}
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {

Loading…
Cancel
Save