File tree Expand file tree Collapse file tree 3 files changed +28
-6
lines changed
src/code_generation/locator Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Original file line number Diff line number Diff line change
1
+ abstract class InitializableDependency {
2
+ /// Handles Asynchronously initialization.
3
+ Future <void > init ();
4
+ }
Original file line number Diff line number Diff line change @@ -118,19 +118,36 @@ class FactoryParam {
118
118
const factoryParam = FactoryParam ._();
119
119
120
120
/// Registers the type passed in to be presolved using the function passed in
121
+ @Deprecated ('Use InitializableSingleton instead.' )
121
122
class Presolve extends DependencyRegistration {
122
123
/// The static instance Future function to use for resolving the type registered
123
- final Future Function ()? presolveUsing;
124
+ final Future Function () presolveUsing;
124
125
125
126
const Presolve ({
126
127
Type ? classType,
127
128
Type ? asType,
128
- this .presolveUsing,
129
+ required this .presolveUsing,
129
130
Set <String >? environments,
130
131
String ? instanceName,
131
132
}) : super (
132
- instanceName: instanceName,
133
- classType: classType,
134
- asType: asType,
135
- environments: environments);
133
+ instanceName: instanceName,
134
+ classType: classType,
135
+ asType: asType,
136
+ environments: environments,
137
+ );
138
+ }
139
+
140
+ /// Registers the type passed in to be presolved using the function passed in
141
+ class InitializableSingleton extends DependencyRegistration {
142
+ const InitializableSingleton ({
143
+ Type ? classType,
144
+ Type ? asType,
145
+ Set <String >? environments,
146
+ String ? instanceName,
147
+ }) : super (
148
+ instanceName: instanceName,
149
+ classType: classType,
150
+ asType: asType,
151
+ environments: environments,
152
+ );
136
153
}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ library stacked_shared;
6
6
export 'src/backward_compatibility/flutter_v2_compatibility.dart' ;
7
7
export 'src/code_generation/environment_filter.dart' ;
8
8
export 'src/code_generation/forms/stacked_form_annotations.dart' ;
9
+ export 'src/code_generation/locator/initializable_dependency.dart' ;
9
10
export 'src/code_generation/locator/stacked_locator.dart' ;
10
11
export 'src/code_generation/locator/stacked_locator_annotations.dart' ;
11
12
export 'src/code_generation/logger/stacked_logger_annotations.dart' ;
You can’t perform that action at this time.
0 commit comments