ConfigurableCombine class abstract
Combine multiple Configurable
s into one Configurable
.
ConfigurableCombine
is used to compose/combine configurables:
class AppConfigurables extends ConfigurableCombine {
@override
List<Configurable> combine() {
return [
Final<Repository>(equal: (scope) => Repository()),
Final<AppNotifier>(equal: (scope) => AppNotifier(
repository: scope.get<Repository>(),
)),
];
}
}
Then, it can be used as:
final scope = await Scope.root([
AppConfigurables(),
]);
final repository = scope.get<Repository>();
final appNotifier = scope.get<AppNotifier>();
- Implemented types
Constructors
- ConfigurableCombine()
-
Enable const constructor for subclasses
const
-
ConfigurableCombine.impl({required List<
Configurable> configurables}) -
constfactory
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
-
combine(
) → List< Configurable> -
Combine multiple
Configurable
into one configurable. -
configure(
ConfigurableScope scope) → FutureOr< void> -
configure
is used to configure scope synchronously or asynchronously.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited