FactoryWithParam class
FactoryWithParam
is a class that extends DependencyRegistration. It provides a way
to register an object as a Factory with parameter to the get_it
locator.
A Factory with parameter means that a new instance of the object will be created each time it is fetched, and the parameters will be passed to the factory function to create the instance.
Example:
import 'package:stacked_shared/stacked_shared.dart';
class FactoryService {
final String? data1;
final double? data2;
FactoryService(@factoryParam this.data1, {@factoryParam this.data2});
}
- Inheritance
-
- Object
- DependencyRegistration
- FactoryWithParam
Constructors
Properties
- asType → Type?
-
An abstracted class type of service to register
finalinherited
- classType → Type?
-
The type of the service to register
finalinherited
- dispose → Function?
-
finalinherited
-
environments
→ Set<
String> ? -
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- instanceName → String?
-
finalinherited
- param1 → Type?
-
finalinherited
- param2 → Type?
-
finalinherited
- resolveUsing → Function?
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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