@@ -18,13 +18,13 @@ abstract class WillSignalReady {}
18
18
/// higher scope which will shadow it.
19
19
/// It also will get notified if the shadowing object is removed from GetIt
20
20
///
21
- /// This can be helpful to unsubscibe / resubscribe from Streams or Listenables
21
+ /// This can be helpful to unsubscribe / resubscribe from Streams or Listenables
22
22
abstract class ShadowChangeHandlers {
23
23
void onGetShadowed (Object shadowing);
24
24
void onLeaveShadow (Object shadowing);
25
25
}
26
26
27
- ///If objects that are registered inside GetIt implements [Disposable] the
27
+ /// If objects that are registered inside GetIt implements [Disposable] the
28
28
/// [onDispose] method will be called whenever that Object is unregistered,
29
29
/// resetted or its enclosing Scope is popped
30
30
abstract class Disposable {
@@ -70,11 +70,11 @@ class InitDependency extends Type {
70
70
}
71
71
72
72
class WaitingTimeOutException implements Exception {
73
- /// In case of an timeout while waiting for an instance to get ready
73
+ /// In case of a timeout while waiting for an instance to get ready
74
74
/// This exception is thrown with information about who is still waiting.
75
75
///
76
76
/// If you pass the [callee] parameter to [isReady] , or define dependent Singletons
77
- /// this maps lists which callees is waiting for whom.
77
+ /// this maps lists which callees are waiting for whom.
78
78
final Map <String , List <String >> areWaitedBy;
79
79
80
80
/// Lists with Types that are still not ready.
@@ -121,7 +121,7 @@ class WaitingTimeOutException implements Exception {
121
121
/// Very simple and easy to use service locator
122
122
/// You register your object creation factory or an instance of an object with [registerFactory] ,
123
123
/// [registerSingleton] or [registerLazySingleton]
124
- /// And retrieve the desired object using [get] or call your locator das as function as its a
124
+ /// And retrieve the desired object using [get] or call your locator as function as its a
125
125
/// callable class
126
126
/// Additionally GetIt offers asynchronous creation functions as well as functions to synchronize
127
127
/// the async initialization of multiple Singletons
@@ -131,7 +131,7 @@ abstract class GetIt {
131
131
/// Optional call-back that will get call whenever a change in the current scope happens
132
132
/// This can be very helpful to update the UI in such a case to make sure it uses
133
133
/// the correct Objects after a scope change
134
- /// The getit_mixin has an matching `rebuiltOnScopeChange` method
134
+ /// The getit_mixin has a matching `rebuiltOnScopeChange` method
135
135
void Function (bool pushed)? onScopeChanged;
136
136
137
137
/// access to the Singleton instance of GetIt
@@ -160,7 +160,7 @@ abstract class GetIt {
160
160
dynamic param2,
161
161
});
162
162
163
- /// Returns an Future of an instance that is created by an async factory or a Singleton that is
163
+ /// Returns a Future of an instance that is created by an async factory or a Singleton that is
164
164
/// not ready with its initialization.
165
165
/// for async factories you can pass up to 2 parameters [param1,param2] they have to match the
166
166
/// types given at registration with [registerFactoryParamAsync()]
@@ -183,7 +183,7 @@ abstract class GetIt {
183
183
/// [factoryFunc] factory function for this type
184
184
/// [instanceName] if you provide a value here your factory gets registered with that
185
185
/// name instead of a type. This should only be necessary if you need to register more
186
- /// than one instance of one type. Its highly not recommended
186
+ /// than one instance of one type. Its highly not recommended.
187
187
void registerFactory <T extends Object >(
188
188
FactoryFunc <T > factoryFunc, {
189
189
String ? instanceName,
@@ -192,13 +192,13 @@ abstract class GetIt {
192
192
/// registers a type so that a new instance will be created on each call of [get] on that type
193
193
/// based on up to two parameters provided to [get()]
194
194
/// [T] type to register
195
- /// [P1] type of param1
196
- /// [P2] type of param2
195
+ /// [P1] type of param1
196
+ /// [P2] type of param2
197
197
/// if you use only one parameter pass void here
198
198
/// [factoryFunc] factory function for this type that accepts two parameters
199
199
/// [instanceName] if you provide a value here your factory gets registered with that
200
200
/// name instead of a type. This should only be necessary if you need to register more
201
- /// than one instance of one type. Its highly not recommended
201
+ /// than one instance of one type. Its highly not recommended.
202
202
///
203
203
/// example:
204
204
/// getIt.registerFactoryParam<TestClassParam,String,int>((s,i)
@@ -214,28 +214,28 @@ abstract class GetIt {
214
214
});
215
215
216
216
/// registers a type so that a new instance will be created on each call of [getAsync] on that type
217
- /// the creation function is executed asynchronously and has to be accessed with [getAsync]
217
+ /// the creation function is executed asynchronously and has to be accessed with [getAsync]
218
218
/// [T] type to register
219
219
/// [factoryFunc] async factory function for this type
220
220
/// [instanceName] if you provide a value here your factory gets registered with that
221
221
/// name instead of a type. This should only be necessary if you need to register more
222
- /// than one instance of one type. Its highly not recommended
222
+ /// than one instance of one type. Its highly not recommended.
223
223
void registerFactoryAsync <T extends Object >(
224
224
FactoryFuncAsync <T > factoryFunc, {
225
225
String ? instanceName,
226
226
});
227
227
228
228
/// registers a type so that a new instance will be created on each call of [getAsync]
229
229
/// on that type based on up to two parameters provided to [getAsync()]
230
- /// the creation function is executed asynchronously and has to be accessed with [getAsync]
230
+ /// the creation function is executed asynchronously and has to be accessed with [getAsync]
231
231
/// [T] type to register
232
- /// [P1] type of param1
233
- /// [P2] type of param2
232
+ /// [P1] type of param1
233
+ /// [P2] type of param2
234
234
/// if you use only one parameter pass void here
235
235
/// [factoryFunc] factory function for this type that accepts two parameters
236
236
/// [instanceName] if you provide a value here your factory gets registered with that
237
237
/// name instead of a type. This should only be necessary if you need to register more
238
- /// than one instance of one type. Its highly not recommended
238
+ /// than one instance of one type. Its highly not recommended.
239
239
///
240
240
/// example:
241
241
/// getIt.registerFactoryParam<TestClassParam,String,int>((s,i) async
@@ -255,9 +255,9 @@ abstract class GetIt {
255
255
/// [T] type to register
256
256
/// [instanceName] if you provide a value here your instance gets registered with that
257
257
/// name instead of a type. This should only be necessary if you need to register more
258
- /// than one instance of one type. Its highly not recommended
258
+ /// than one instance of one type. Its highly not recommended.
259
259
/// If [signalsReady] is set to `true` it means that the future you can get from `allReady()`
260
- /// cannot complete until this this instance was signalled ready by calling
260
+ /// cannot complete until this instance was signalled ready by calling
261
261
/// [signalsReady(instance)] .
262
262
void registerSingleton <T extends Object >(
263
263
T instance, {
@@ -266,17 +266,17 @@ abstract class GetIt {
266
266
DisposingFunc <T >? dispose,
267
267
});
268
268
269
- /// registers a type as Singleton by passing an factory function of that type
269
+ /// registers a type as Singleton by passing a factory function of that type
270
270
/// that will be called on each call of [get] on that type
271
271
/// [T] type to register
272
272
/// [instanceName] if you provide a value here your instance gets registered with that
273
273
/// name instead of a type. This should only be necessary if you need to register more
274
- /// than one instance of one type. Its highly not recommended
275
- /// [dependsOn] if this instance depends on other registered Singletons before it can be
274
+ /// than one instance of one type. Its highly not recommended.
275
+ /// [dependsOn] if this instance depends on other registered Singletons before it can be
276
276
/// initialized you can either orchestrate this manually using [isReady()] or pass a list of
277
277
/// the types that the instance depends on here. [factoryFunc] won't get executed till this
278
278
/// types are ready. [func] is called if [signalsReady] is set to `true` it means that the
279
- /// future you can get from `allReady()` cannot complete until this this instance was
279
+ /// future you can get from `allReady()` cannot complete until this instance was
280
280
/// signalled ready by calling [signalsReady(instance)] .
281
281
void registerSingletonWithDependencies <T extends Object >(
282
282
FactoryFunc <T > factoryFunc, {
@@ -295,12 +295,12 @@ abstract class GetIt {
295
295
/// (see below). As soon as it returns, this instance is marked as ready unless you don't
296
296
/// set [signalsReady==true] [instanceName] if you provide a value here your instance gets
297
297
/// registered with that name instead of a type. This should only be necessary if you need to
298
- /// register more than one instance of one type. Its highly not recommended
299
- /// [dependsOn] if this instance depends on other registered Singletons before it can be
298
+ /// register more than one instance of one type. Its highly not recommended.
299
+ /// [dependsOn] if this instance depends on other registered Singletons before it can be
300
300
/// initialized you can either orchestrate this manually using [isReady()] or pass a list of
301
- /// the types that the instance depends on here. [factoryFunc] won't get executed till this
301
+ /// the types that the instance depends on here. [factoryFunc] won't get executed till this
302
302
/// types are ready. If [signalsReady] is set to `true` it means that the future you can get
303
- /// from `allReady()` cannot complete until this this instance was signalled ready by calling
303
+ /// from `allReady()` cannot complete until this instance was signalled ready by calling
304
304
/// [signalsReady(instance)] . In that case no automatic ready signal is made after
305
305
/// completion of [factoryFunc]
306
306
void registerSingletonAsync <T extends Object >(
@@ -317,7 +317,7 @@ abstract class GetIt {
317
317
/// [factoryFunc] factory function for this type
318
318
/// [instanceName] if you provide a value here your factory gets registered with that
319
319
/// name instead of a type. This should only be necessary if you need to register more
320
- /// than one instance of one type. Its highly not recommended
320
+ /// than one instance of one type. Its highly not recommended.
321
321
/// [registerLazySingleton] does not influence [allReady] however you can wait
322
322
/// for and be dependent on a LazySingleton.
323
323
void registerLazySingleton <T extends Object >(
@@ -326,8 +326,8 @@ abstract class GetIt {
326
326
DisposingFunc <T >? dispose,
327
327
});
328
328
329
- /// registers a type as Singleton by passing a async factory function that will be called
330
- /// on the first call of [getAsnc ] on that type
329
+ /// registers a type as Singleton by passing an async factory function that will be called
330
+ /// on the first call of [getAsync ] on that type
331
331
/// This is a rather esoteric requirement so you should seldom have the need to use it.
332
332
/// This factory function [factoryFunc] isn't called immediately but wait till the first call by
333
333
/// [getAsync()] or [isReady()] is made
@@ -371,7 +371,7 @@ abstract class GetIt {
371
371
/// [scopeName] if you name a scope you can pop all scopes above the named one
372
372
/// by using the name.
373
373
/// [dispose] function that will be called when you pop this scope. The scope
374
- /// is still valied while it is executed
374
+ /// is still valid while it is executed
375
375
/// [init] optional function to register Objects immediately after the new scope is
376
376
/// pushed. This ensures that [onScopeChanged] will be called after their registration
377
377
void pushNewScope ({
@@ -380,9 +380,9 @@ abstract class GetIt {
380
380
ScopeDisposeFunc ? dispose,
381
381
});
382
382
383
- /// Disposes all factories/Singletons that have ben registered in this scope
383
+ /// Disposes all factories/Singletons that have been registered in this scope
384
384
/// and pops (destroys) the scope so that the previous scope gets active again.
385
- /// if you provided dispose functions on registration, they will be called.
385
+ /// if you provided dispose functions on registration, they will be called.
386
386
/// if you passed a dispose function when you pushed this scope it will be
387
387
/// called before the scope is popped.
388
388
/// As dispose functions can be async, you should await this function.
@@ -392,7 +392,7 @@ abstract class GetIt {
392
392
/// scopes above the scope with [name] including that scope unless [inclusive] = false
393
393
/// Scopes are popped in order from the top
394
394
/// As dispose functions can be async, you should await this function.
395
- /// It no scope with [name] exists, nothing is popped and `false` is returned
395
+ /// If no scope with [name] exists, nothing is popped and `false` is returned
396
396
Future <bool > popScopesTill (String name, {bool inclusive = true });
397
397
398
398
/// Returns the name of the current scope if it has one otherwise null
@@ -415,7 +415,7 @@ abstract class GetIt {
415
415
416
416
/// Unregister an [instance] of an object or a factory/singleton by Type [T] or by name
417
417
/// [instanceName] if you need to dispose any resources you can do it using
418
- /// [disposingFunction] function that provides a instance of your class to be disposed.
418
+ /// [disposingFunction] function that provides an instance of your class to be disposed.
419
419
/// This function overrides the disposing you might have provided when registering.
420
420
FutureOr unregister <T extends Object >({
421
421
Object ? instance,
@@ -427,7 +427,7 @@ abstract class GetIt {
427
427
/// Singleton that had [signalsReady==true] are ready.
428
428
/// This can be used inside a FutureBuilder to change the UI as soon as all initialization
429
429
/// is done
430
- /// If you pass a [timeout] , an [WaitingTimeOutException] will be thrown if not all Singletons
430
+ /// If you pass a [timeout] , a [WaitingTimeOutException] will be thrown if not all Singletons
431
431
/// were ready in the given time. The Exception contains details on which Singletons are not
432
432
/// ready yet. if [allReady] should not wait for the completion of async Singletons set
433
433
/// [ignorePendingAsyncCreation==true]
@@ -436,9 +436,9 @@ abstract class GetIt {
436
436
bool ignorePendingAsyncCreation = false ,
437
437
});
438
438
439
- /// Returns a Future that completes if the instance of an Singleton, defined by Type [T] or
440
- /// by name [instanceName] or by passing the an existing [instance] , is ready
441
- /// If you pass a [timeout] , an [WaitingTimeOutException] will be thrown if the instance
439
+ /// Returns a Future that completes if the instance of a Singleton, defined by Type [T] or
440
+ /// by name [instanceName] or by passing an existing [instance] , is ready
441
+ /// If you pass a [timeout] , a [WaitingTimeOutException] will be thrown if the instance
442
442
/// is not ready in the given time. The Exception contains details on which Singletons are
443
443
/// not ready at that time.
444
444
/// [callee] optional parameter which makes debugging easier. Pass `this` in here.
@@ -477,7 +477,7 @@ abstract class GetIt {
477
477
/// will complete the future you got from [allReady] , so it can be used to globally
478
478
/// giving a ready Signal
479
479
///
480
- /// Both ways are mutual exclusive, meaning either only use the global `signalReady()` and
480
+ /// Both ways are mutually exclusive, meaning either only use the global `signalReady()` and
481
481
/// don't register a singleton to signal ready or use any async registrations
482
482
///
483
483
/// Or use async registrations methods or let individual instances signal their ready
0 commit comments