@@ -45,15 +45,15 @@ abstract class IModularBase {
45
45
IModularNavigator ? navigatorDelegate;
46
46
47
47
/// Request an instance by [Type]
48
- B get <B extends Object >();
48
+ B get <B extends Object >({ String ? key} );
49
49
50
50
/// Request an instance by [Type]
51
51
/// <br>
52
52
/// Return null if not found instance
53
- B ? tryGet <B extends Object >();
53
+ B ? tryGet <B extends Object >({ String ? key} );
54
54
55
55
/// Dispose a bind by [Type]
56
- bool dispose <B extends Object >();
56
+ bool dispose <B extends Object >({ String ? key} );
57
57
58
58
/// Navigator 2.0 initializator: RouteInformationParser
59
59
ModularRouteInformationParser get routeInformationParser;
@@ -83,7 +83,7 @@ abstract class IModularBase {
83
83
void unbindModule <T extends Module >({String ? type});
84
84
85
85
/// replace instance
86
- void replaceInstance <T >(T instance, [ Type ? module] );
86
+ void replaceInstance <T >(T instance, { String ? key} );
87
87
88
88
@visibleForTesting
89
89
String get initialRoutePath;
@@ -132,17 +132,17 @@ class ModularBase implements IModularBase {
132
132
});
133
133
134
134
@override
135
- bool dispose <B extends Object >() =>
136
- disposeBind <B >().getOrElse ((left) => false );
135
+ bool dispose <B extends Object >({ String ? key} ) =>
136
+ disposeBind <B >(key ).getOrElse ((left) => false );
137
137
138
138
@override
139
- B get <B extends Object >() {
140
- return getBind <B >().getOrThrow ();
139
+ B get <B extends Object >({ String ? key} ) {
140
+ return getBind <B >(key ).getOrThrow ();
141
141
}
142
142
143
143
@override
144
- B ? tryGet <B extends Object >() {
145
- return getBind <B >().getOrNull ();
144
+ B ? tryGet <B extends Object >({ String ? key} ) {
145
+ return getBind <B >(key ).getOrNull ();
146
146
}
147
147
148
148
@override
@@ -201,7 +201,8 @@ class ModularBase implements IModularBase {
201
201
routerDelegate: routerDelegate,
202
202
routeInformationParser: routeInformationParser,
203
203
routeInformationProvider: PlatformRouteInformationProvider (
204
- initialRouteInformation: const RouteInformation (),
204
+ // ignore: deprecated_member_use
205
+ initialRouteInformation: const RouteInformation (location: '/' ),
205
206
),
206
207
backButtonDispatcher: RootBackButtonDispatcher (),
207
208
);
@@ -217,7 +218,7 @@ class ModularBase implements IModularBase {
217
218
}
218
219
219
220
@override
220
- void replaceInstance <T >(T instance, [ Type ? module] ) {
221
- replaceInstanceUsecase.call <T >(instance, module ).getOrThrow ();
221
+ void replaceInstance <T >(T instance, { String ? key} ) {
222
+ replaceInstanceUsecase.call <T >(instance, key ).getOrThrow ();
222
223
}
223
224
}
0 commit comments