UMvvmApp<NavigationInteractorType extends BaseNavigationInteractor<dynamic, dynamic, dynamic, RoutesBase, RoutesBase, RoutesBase, dynamic, dynamic, dynamic, BaseDeepLinksInteractor> > class
abstract
Main class for UMvvm application
It contains global InstanceCollection and EventBus It performs initial setup for interactors and view models (register builders for interactors and register singletons)
Do not forget to setup UMvvmApp.cacheGetDelegate and UMvvmApp.cachePutDelegate before calling initialize
@mainApp
class App extends UMvvmApp with AppGen {
static late SharedPreferences prefs;
@override
Future<void> initialize() async {
await super.initialize();
}
}
final app = App();
Future<void> initApp() async {
App.prefs = await SharedPreferences.getInstance();
UMvvmApp.cacheGetDelegate = (key) {
return App.prefs.getString(key) ?? '';
};
UMvvmApp.cachePutDelegate = (key, value) async {
return App.prefs.setString(key, value);
};
await app.initialize();
}
Constructors
Properties
- eventBus → EventBus
-
Main app event bus
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- instances → InstanceCollection
-
Main app instances collection
final
- isInitialized → bool
-
Flag indicating that all mvvm instances are created and registered
no setter
-
Navigation interactor for this app
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
singletonInstances
→ List<
Connector> -
Collection of singletion instances
no setter
Methods
-
createSingletons(
) → Future< void> -
initialize(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerInstances(
) → void - Method to register builders for instances
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- cacheGetDelegate ↔ LocaleCacheGetDelegate
-
Delegate function to get data from
SharedPreferences
getter/setter pair - cachePutDelegate ↔ LocaleCachePutDelegate
-
Delegate function to put data to
SharedPreferences
getter/setter pair - isInTestMode ↔ bool
-
Flag indicating test mode
getter/setter pair
-
Navigation interactor for this app
final