@@ -38,7 +38,7 @@ enum _ServiceFactoryType {
38
38
alwaysNew, // factory which means on every call of [get] a new instance is created
39
39
constant, // normal singleton
40
40
lazy, // lazy
41
- cachedFactory, // cached factoryj
41
+ cachedFactory, // cached factory
42
42
}
43
43
44
44
/// If I use `Singleton` without specifier in the comments I mean normal and lazy
@@ -114,7 +114,7 @@ class _ServiceFactory<T extends Object, P1, P2> {
114
114
115
115
final bool shouldSignalReady;
116
116
117
- int _refenceCount = 0 ;
117
+ int _referenceCount = 0 ;
118
118
119
119
_ServiceFactory (
120
120
this ._getItInstance,
@@ -251,7 +251,7 @@ class _ServiceFactory<T extends Object, P1, P2> {
251
251
}
252
252
253
253
/// returns an async instance depending on the type of the registration if [async==true] or
254
- /// if [dependsOn.isnoEmpty ] .
254
+ /// if [dependsOn.isNotEmpty ] .
255
255
Future <R > getObjectAsync <R >(dynamic param1, dynamic param2) async {
256
256
assert (
257
257
! (factoryType != _ServiceFactoryType .alwaysNew &&
@@ -512,7 +512,7 @@ class _GetItImplementation implements GetIt {
512
512
bool allowReassignment = false ;
513
513
514
514
/// By default it's throws error when [allowReassignment] = false. and trying to register same type
515
- /// If you really need, you can disable the Asserts / Errror by setting[skipDoubleRegistration] = true
515
+ /// If you really need, you can disable the Asserts / Error by setting[skipDoubleRegistration] = true
516
516
@visibleForTesting
517
517
@override
518
518
bool skipDoubleRegistration = false ;
@@ -943,9 +943,9 @@ class _GetItImplementation implements GetIt {
943
943
/// [unregister] or [releaseInstance] calls will decrement the reference counter an won't unregister
944
944
/// and dispose the registration as long as the reference counter is > 0.
945
945
/// [T] type/interface that is used for the registration and the access via [get]
946
- /// [factoryFunc] that is callled to create the instance if it is not already registered
946
+ /// [factoryFunc] that is called to create the instance if it is not already registered
947
947
/// [instanceName] optional key to register more than one instance of one type
948
- /// [dispose] disposing function that is autmatically called before the object is removed from get_it
948
+ /// [dispose] disposing function that is automatically called before the object is removed from get_it
949
949
@override
950
950
T registerSingletonIfAbsent <T extends Object >(
951
951
T Function () factoryFunc, {
@@ -960,7 +960,7 @@ class _GetItImplementation implements GetIt {
960
960
! existingFactory.isAsync,
961
961
StateError (
962
962
'registerSingletonIfAbsent can only be called for a type that is already registered as Singleton and not for factories or async/lazy Singletons' ));
963
- existingFactory._refenceCount ++ ;
963
+ existingFactory._referenceCount ++ ;
964
964
return existingFactory.instance! ;
965
965
}
966
966
@@ -976,20 +976,20 @@ class _GetItImplementation implements GetIt {
976
976
return instance;
977
977
}
978
978
979
- /// checks if a regiserter Singleton has an reference counter > 0
979
+ /// checks if a registered Singleton has an reference counter > 0
980
980
/// if so it decrements the reference counter and if it reaches 0 it
981
981
/// unregisters the Singleton
982
982
/// if called on an object that's reference counter was never incremented
983
983
/// it will immediately unregister and dispose the object
984
984
@override
985
985
void releaseInstance (Object instance) {
986
- final registerdFactory = _findFactoryByInstance (instance);
987
- if (registerdFactory._refenceCount < 1 ) {
988
- assert (registerdFactory._refenceCount == 0 ,
986
+ final registeredFactory = _findFactoryByInstance (instance);
987
+ if (registeredFactory._referenceCount < 1 ) {
988
+ assert (registeredFactory._referenceCount == 0 ,
989
989
'GetIt: releaseInstance was called on an object that was already released' );
990
990
unregister (instance: instance);
991
991
} else {
992
- registerdFactory._refenceCount -- ;
992
+ registeredFactory._referenceCount -- ;
993
993
}
994
994
}
995
995
@@ -1110,8 +1110,8 @@ class _GetItImplementation implements GetIt {
1110
1110
/// Unregister an instance of an object or a factory/singleton by Type [T] or by name [instanceName]
1111
1111
/// if you need to dispose any resources you can pass in a [disposingFunction] function
1112
1112
/// that provides an instance of your class to be disposed
1113
- /// If you have provided an disposing functin when you registered the object that one will be called automatically
1114
- /// If you have enabled referece counting when registering, [unregister] will only unregister and dispose the object
1113
+ /// If you have provided an disposing function when you registered the object that one will be called automatically
1114
+ /// If you have enabled reference counting when registering, [unregister] will only unregister and dispose the object
1115
1115
/// if referenceCount is 0
1116
1116
///
1117
1117
@override
@@ -1132,8 +1132,8 @@ class _GetItImplementation implements GetIt {
1132
1132
),
1133
1133
);
1134
1134
1135
- if (factoryToRemove._refenceCount > 0 ) {
1136
- factoryToRemove._refenceCount -- ;
1135
+ if (factoryToRemove._referenceCount > 0 ) {
1136
+ factoryToRemove._referenceCount -- ;
1137
1137
return ;
1138
1138
}
1139
1139
final typeRegistration = factoryToRemove.registeredIn;
@@ -1361,7 +1361,7 @@ class _GetItImplementation implements GetIt {
1361
1361
} catch (e) {
1362
1362
final failedScope = _scopes.last;
1363
1363
1364
- /// prevend any new registrations in this scope
1364
+ /// prevent any new registrations in this scope
1365
1365
failedScope.isFinal = true ;
1366
1366
failedScope.reset (dispose: true );
1367
1367
_scopes.removeLast ();
@@ -1416,7 +1416,7 @@ class _GetItImplementation implements GetIt {
1416
1416
} catch (e) {
1417
1417
final failedScope = _scopes.last;
1418
1418
1419
- /// prevend any new registrations in this scope
1419
+ /// prevent any new registrations in this scope
1420
1420
failedScope.isFinal = true ;
1421
1421
await failedScope.reset (dispose: true );
1422
1422
_scopes.removeLast ();
0 commit comments