DependentKoreInstance<Input> mixin
Mixin that contains declarations of instance dependencies
Contains methods to declare, initialize and get them
If used you need to call initializeDependencies in BaseKoreInstance.initialize call And call disposeDependencies in BaseKoreInstance.dispose call
Example:
abstract class BaseBox extends BaseKoreInstance<dynamic> with DependentKoreInstance<dynamic> {
String get boxName;
late final hiveWrapper = app.instances.get<HiveWrapper>();
@mustCallSuper
@override
void initialize(dynamic input) {
super.initialize(input);
initializeDependencies();
}
@mustCallSuper
@override
void dispose() {
super.dispose();
disposeDependencies();
}
}
- Superclass constraints
- KoreInstance<
Input>
- KoreInstance<
- Mixin applications
Properties
-
allDependenciesReady
→ Observable<
bool> -
Observable holding value of successfull dependencies initialization
final
-
allPartsReady
→ Observable<
bool> -
Observable indicating that all parts are connected to this instance
finalinherited
- configuration → DependentKoreInstanceConfiguration
-
DependentKoreInstanceConfiguration for this instance
no setteroverride
-
disposeOperations
→ List<
Function> -
List of operations that will be executed with dispose call
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initializationCompleter → Completer
-
finalinherited
- input ↔ Input
-
Input for this instance
latefinalinherited
- isAsync → bool
-
Getter that returns true if instance contains async parts
or require async initialization
no setteroverride
- isDisposed ↔ bool
-
Flag indicating that this instance is disposed
getter/setter pairinherited
- isInitialized ↔ bool
-
Flag indicating that this instance is fully initialized
getter/setter pairinherited
- isPaused ↔ bool
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkEventWasReceived(
Type event, {int? count}) → bool -
Returns true if underlying events list contains given event name
inherited
-
cleanupReceivedEvents(
) → void -
Cleans collection of received events
inherited
-
disposeDependencies(
) → void - Disposes all dependencies
-
disposeEventBusSubscription(
) → void -
Closes underlying stream subscription for EventBus
inherited
-
disposeInstance(
) → void -
Base method for instance dispose
inherited
-
ensureInitialized<
O> (Future< O> block()) → Future<O> -
Helper function that runs given block after async initialization is
completed.
inherited
-
getFullConnectorsList(
) → List< Connector> - Returns list of dependencies from every module and combines it with local dependencies
-
getFullPartConnectorsList(
) → List< PartConnector> -
Returns list of parts from every module
and combines it with local parts
override
-
initialize(
Input input) → void -
Base method for instance initialization
inherited
-
initializeAsync(
) → Future< void> -
Base method for async instance initialization.
inherited
-
initializeDependencies(
) → void - Initializes all dependencies and increase reference count in ScopedContainer
-
initializeDependenciesAsync(
) → Future< void> -
initializeEventBusSubscription(
) → void -
inherited
-
initializeInstanceParts(
) → void -
Adds parts to local collection
inherited
-
initializeInstancePartsAsync(
) → Future< void> -
Adds parts to local collection
inherited
-
initializeWithoutConnections(
Input input) → void -
Base method for lightweight instance initialization
inherited
-
initializeWithoutConnectionsAsync(
) → Future< void> -
Base method for lightweight async instance initialization
inherited
-
markInitialized(
) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on<
T> (EventBusSubscriber< T> processor, {bool reactsToPause = false, bool firesAfterResume = true}) → EventBusSubscriber -
Subscribes to event of given type
inherited
-
onAllDependenciesReady(
) → void - Runs after every async instance is initialized
-
onAllPartReady(
) → void -
Runs for every async part when it is initialized
inherited
-
onAsyncInstanceReady(
Type type, int? index) → void - Runs for every async instance when it is initialized
-
onAsyncPartReady(
Type type, int? index) → void -
Runs for every async part when it is initialized
inherited
-
pauseEventBusSubscription(
) → void -
Sets paused flag to false so events stop processing
override
-
resumeEventBusSubscription(
{bool sendAllEventsReceivedWhilePause = true}) → void -
Resumes events processing
override
-
subscribe(
) → void -
Map of EventBus events and function to be executed for this events
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
useAsyncLazyLocalInstance<
T extends BaseKoreInstance> ({int index = 0}) → Future< T> - Returns connected instance of given type
-
useInstancePart<
InstancePartType extends BaseInstancePart< (dynamic, KoreInstance> >{int index = 0}) → InstancePartType -
Returns initialized instance part for given type
inherited
-
useLazyLocalInstance<
T extends BaseKoreInstance> ({int index = 0}) → T - Returns connected instance of given type
-
useLocalInstance<
T extends BaseKoreInstance> ({int index = 0}) → T - Returns connected instance of given type
-
useModule<
T extends InstancesModule> () → T - Connects module from dependencies and returns its reference
-
waitTillEventIsReceived(
Type event, {int? count, Duration timeout = const Duration(seconds: 1)}) → Future< void> -
Waits till given event is received by this instance
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited