mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 05:25:19 +00:00
refactored pr
This commit is contained in:
@@ -22,15 +22,15 @@ class FeatureModule extends Module {
|
||||
.withName('networkRepo')
|
||||
.toProvide(
|
||||
() => NetworkDataRepository(
|
||||
currentScope.resolve<ApiClient>(
|
||||
named: isMock ? 'apiClientMock' : 'apiClientImpl',
|
||||
),
|
||||
),
|
||||
)
|
||||
currentScope.resolve<ApiClient>(
|
||||
named: isMock ? 'apiClientMock' : 'apiClientImpl',
|
||||
),
|
||||
),
|
||||
)
|
||||
.singleton();
|
||||
|
||||
bind<DataBloc>().toProvideWithParam(
|
||||
(param) => DataBloc(
|
||||
bind<DataBloc>().toProvideWithParams(
|
||||
(param) => DataBloc(
|
||||
currentScope.resolve<DataRepository>(named: 'networkRepo'),
|
||||
param,
|
||||
),
|
||||
@@ -47,7 +47,7 @@ void main() async {
|
||||
.openSubScope('featureScope')
|
||||
.installModules([FeatureModule(isMock: true)]);
|
||||
|
||||
final dataBloc = subScope.resolve<DataBloc>(param: 'PARAMETER');
|
||||
final dataBloc = subScope.resolve<DataBloc>(params: 'PARAMETER');
|
||||
dataBloc.data.listen((d) => print('Received data: $d'),
|
||||
onError: (e) => print('Error: $e'), onDone: () => print('DONE'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user