ReactterInstanceManager class abstract
A mixin-class that adds instances management features to classes that use it.
It allows registering, unregistering, getting, creating, and deleting instances of a certain type.
It also provides methods to check if an instance exists and to get the instance of a certain type with a given ID.
It stores instances and their builders, and emits lifecycle events when instances are registered, unregistered, initialized, and destroyed.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
builder<
T extends Object?> (InstanceBuilder< T> builder, {String? id, Object? ref}) → T? - It's a ways to manage an instance, which registers a builder function and creates the instance, unless it has already done so.
-
create<
T extends Object?> (InstanceBuilder< T> builder, {String? id, Object? ref, InstanceManageMode mode = InstanceManageMode.builder}) → T? -
Registers, creates and/or gets the instance of
T
with anid
optional. -
delete<
T extends Object?> ([String? id, Object? ref]) → bool - Deletes the instance from the store if it has been removed from all references and meets the conditions of instance type.
-
destroy<
T extends Object?> ({String? id, bool onlyInstance = false}) → bool -
Destroys the instance and builder of
T
type with anid
optional. -
exists<
T extends Object?> ([String? id]) → bool -
Valids if the instance of
T
type withid
optional exists. -
factory<
T extends Object?> (InstanceBuilder< T> builder, {String? id, Object? ref}) → T? - It's a ways to manage an instance, which registers a builder function only once and creates the instance if not already done.
-
find<
T extends Object?> ([String? id]) → T? -
Gets the instance of
T
type with anid
optional. -
get<
T extends Object?> ([String? id, Object? ref]) → T? -
Creates and/or gets the instance of
T
with anid
optional. -
getInstanceManageMode(
Object? instance) → InstanceManageMode? - Returns InstanceManageMode of instance parameter.
-
isRegistered(
Object? instance) → bool - Checks if an instance is registered in Reactter.
-
lazyBuilder<
T extends Object?> (InstanceBuilder< T> builder, {String? id}) → bool -
Register a
builder
function for creating a new instance ofT
with anid
optional as InstanceManageMode.builder. -
lazyFactory<
T extends Object?> (InstanceBuilder< T> builder, {String? id}) → bool -
Register a
builder
function for creating a new instance ofT
with anid
optional as InstanceManageMode.factory. -
lazySingleton<
T extends Object?> (InstanceBuilder< T> builder, {String? id}) → bool -
Register a
builder
function for creating a new instance ofT
with anid
optional as InstanceManageMode.singleton. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register<
T extends Object?> (InstanceBuilder< T> builder, {String? id, InstanceManageMode mode = InstanceManageMode.builder}) → bool -
Register a
builder
function for creating a new instance ofT
with anid
optional. -
singleton<
T extends Object?> (InstanceBuilder< T> builder, {String? id, Object? ref}) → T? - It's a ways to manage a instance, which registers a builder function and creates the instance only once.
-
toString(
) → String -
A string representation of this object.
inherited
-
unregister<
T extends Object?> ([String? id]) → bool -
Removes a builder function registed of
T
type with anid
optional.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited