Browse Source

neon: inject provider for all apps

neon: make AppsBloc.getAppProviders a getter
pull/371/head
Nikolas Rimikis 2 years 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;
}
List<Provider>? getAppProviders() => appImplementations.valueOrNull?.data
?.map((final appImplementation) => appImplementation.blocProvider(_account.client))
.toList();
List<Provider> get appBlocProviders =>
_allAppImplementations.map((final appImplementation) => appImplementation.blocProvider(_account.client)).toList();
}

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

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

Loading…
Cancel
Save