Skip to content

Commit c8637fa

Browse files
authored
Merge pull request #255 from selcukguvel/master
Fix typos in codebase
2 parents ca41db3 + 66b45d4 commit c8637fa

File tree

7 files changed

+139
-132
lines changed

7 files changed

+139
-132
lines changed

README.md

Lines changed: 54 additions & 47 deletions
Large diffs are not rendered by default.

example/lib/app_model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AppModelImplementation extends AppModel {
1212
int _counter = 0;
1313

1414
AppModelImplementation() {
15-
/// lets pretend we have to do some async initilization
15+
/// lets pretend we have to do some async initialization
1616
Future.delayed(Duration(seconds: 3)).then((_) => getIt.signalReady(this));
1717
}
1818

lib/get_it.dart

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ abstract class WillSignalReady {}
1818
/// higher scope which will shadow it.
1919
/// It also will get notified if the shadowing object is removed from GetIt
2020
///
21-
/// This can be helpful to unsubscibe / resubscribe from Streams or Listenables
21+
/// This can be helpful to unsubscribe / resubscribe from Streams or Listenables
2222
abstract class ShadowChangeHandlers {
2323
void onGetShadowed(Object shadowing);
2424
void onLeaveShadow(Object shadowing);
2525
}
2626

27-
///If objects that are registered inside GetIt implements [Disposable] the
27+
/// If objects that are registered inside GetIt implements [Disposable] the
2828
/// [onDispose] method will be called whenever that Object is unregistered,
2929
/// resetted or its enclosing Scope is popped
3030
abstract class Disposable {
@@ -70,11 +70,11 @@ class InitDependency extends Type {
7070
}
7171

7272
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
7474
/// This exception is thrown with information about who is still waiting.
7575
///
7676
/// 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.
7878
final Map<String, List<String>> areWaitedBy;
7979

8080
/// Lists with Types that are still not ready.
@@ -121,7 +121,7 @@ class WaitingTimeOutException implements Exception {
121121
/// Very simple and easy to use service locator
122122
/// You register your object creation factory or an instance of an object with [registerFactory],
123123
/// [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
125125
/// callable class
126126
/// Additionally GetIt offers asynchronous creation functions as well as functions to synchronize
127127
/// the async initialization of multiple Singletons
@@ -131,7 +131,7 @@ abstract class GetIt {
131131
/// Optional call-back that will get call whenever a change in the current scope happens
132132
/// This can be very helpful to update the UI in such a case to make sure it uses
133133
/// 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
135135
void Function(bool pushed)? onScopeChanged;
136136

137137
/// access to the Singleton instance of GetIt
@@ -160,7 +160,7 @@ abstract class GetIt {
160160
dynamic param2,
161161
});
162162

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
164164
/// not ready with its initialization.
165165
/// for async factories you can pass up to 2 parameters [param1,param2] they have to match the
166166
/// types given at registration with [registerFactoryParamAsync()]
@@ -183,7 +183,7 @@ abstract class GetIt {
183183
/// [factoryFunc] factory function for this type
184184
/// [instanceName] if you provide a value here your factory gets registered with that
185185
/// 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.
187187
void registerFactory<T extends Object>(
188188
FactoryFunc<T> factoryFunc, {
189189
String? instanceName,
@@ -192,13 +192,13 @@ abstract class GetIt {
192192
/// registers a type so that a new instance will be created on each call of [get] on that type
193193
/// based on up to two parameters provided to [get()]
194194
/// [T] type to register
195-
/// [P1] type of param1
196-
/// [P2] type of param2
195+
/// [P1] type of param1
196+
/// [P2] type of param2
197197
/// if you use only one parameter pass void here
198198
/// [factoryFunc] factory function for this type that accepts two parameters
199199
/// [instanceName] if you provide a value here your factory gets registered with that
200200
/// 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.
202202
///
203203
/// example:
204204
/// getIt.registerFactoryParam<TestClassParam,String,int>((s,i)
@@ -214,28 +214,28 @@ abstract class GetIt {
214214
});
215215

216216
/// 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]
218218
/// [T] type to register
219219
/// [factoryFunc] async factory function for this type
220220
/// [instanceName] if you provide a value here your factory gets registered with that
221221
/// 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.
223223
void registerFactoryAsync<T extends Object>(
224224
FactoryFuncAsync<T> factoryFunc, {
225225
String? instanceName,
226226
});
227227

228228
/// registers a type so that a new instance will be created on each call of [getAsync]
229229
/// 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]
231231
/// [T] type to register
232-
/// [P1] type of param1
233-
/// [P2] type of param2
232+
/// [P1] type of param1
233+
/// [P2] type of param2
234234
/// if you use only one parameter pass void here
235235
/// [factoryFunc] factory function for this type that accepts two parameters
236236
/// [instanceName] if you provide a value here your factory gets registered with that
237237
/// 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.
239239
///
240240
/// example:
241241
/// getIt.registerFactoryParam<TestClassParam,String,int>((s,i) async
@@ -255,9 +255,9 @@ abstract class GetIt {
255255
/// [T] type to register
256256
/// [instanceName] if you provide a value here your instance gets registered with that
257257
/// 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.
259259
/// 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
261261
/// [signalsReady(instance)].
262262
void registerSingleton<T extends Object>(
263263
T instance, {
@@ -266,17 +266,17 @@ abstract class GetIt {
266266
DisposingFunc<T>? dispose,
267267
});
268268

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
270270
/// that will be called on each call of [get] on that type
271271
/// [T] type to register
272272
/// [instanceName] if you provide a value here your instance gets registered with that
273273
/// 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
276276
/// initialized you can either orchestrate this manually using [isReady()] or pass a list of
277277
/// the types that the instance depends on here. [factoryFunc] won't get executed till this
278278
/// 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
280280
/// signalled ready by calling [signalsReady(instance)].
281281
void registerSingletonWithDependencies<T extends Object>(
282282
FactoryFunc<T> factoryFunc, {
@@ -295,12 +295,12 @@ abstract class GetIt {
295295
/// (see below). As soon as it returns, this instance is marked as ready unless you don't
296296
/// set [signalsReady==true] [instanceName] if you provide a value here your instance gets
297297
/// 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
300300
/// 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
302302
/// 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
304304
/// [signalsReady(instance)]. In that case no automatic ready signal is made after
305305
/// completion of [factoryFunc]
306306
void registerSingletonAsync<T extends Object>(
@@ -317,7 +317,7 @@ abstract class GetIt {
317317
/// [factoryFunc] factory function for this type
318318
/// [instanceName] if you provide a value here your factory gets registered with that
319319
/// 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.
321321
/// [registerLazySingleton] does not influence [allReady] however you can wait
322322
/// for and be dependent on a LazySingleton.
323323
void registerLazySingleton<T extends Object>(
@@ -326,8 +326,8 @@ abstract class GetIt {
326326
DisposingFunc<T>? dispose,
327327
});
328328

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
331331
/// This is a rather esoteric requirement so you should seldom have the need to use it.
332332
/// This factory function [factoryFunc] isn't called immediately but wait till the first call by
333333
/// [getAsync()] or [isReady()] is made
@@ -371,7 +371,7 @@ abstract class GetIt {
371371
/// [scopeName] if you name a scope you can pop all scopes above the named one
372372
/// by using the name.
373373
/// [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
375375
/// [init] optional function to register Objects immediately after the new scope is
376376
/// pushed. This ensures that [onScopeChanged] will be called after their registration
377377
void pushNewScope({
@@ -380,9 +380,9 @@ abstract class GetIt {
380380
ScopeDisposeFunc? dispose,
381381
});
382382

383-
/// Disposes all factories/Singletons that have ben registered in this scope
383+
/// Disposes all factories/Singletons that have been registered in this scope
384384
/// 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.
386386
/// if you passed a dispose function when you pushed this scope it will be
387387
/// called before the scope is popped.
388388
/// As dispose functions can be async, you should await this function.
@@ -392,7 +392,7 @@ abstract class GetIt {
392392
/// scopes above the scope with [name] including that scope unless [inclusive]= false
393393
/// Scopes are popped in order from the top
394394
/// 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
396396
Future<bool> popScopesTill(String name, {bool inclusive = true});
397397

398398
/// Returns the name of the current scope if it has one otherwise null
@@ -415,7 +415,7 @@ abstract class GetIt {
415415

416416
/// Unregister an [instance] of an object or a factory/singleton by Type [T] or by name
417417
/// [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.
419419
/// This function overrides the disposing you might have provided when registering.
420420
FutureOr unregister<T extends Object>({
421421
Object? instance,
@@ -427,7 +427,7 @@ abstract class GetIt {
427427
/// Singleton that had [signalsReady==true] are ready.
428428
/// This can be used inside a FutureBuilder to change the UI as soon as all initialization
429429
/// 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
431431
/// were ready in the given time. The Exception contains details on which Singletons are not
432432
/// ready yet. if [allReady] should not wait for the completion of async Singletons set
433433
/// [ignorePendingAsyncCreation==true]
@@ -436,9 +436,9 @@ abstract class GetIt {
436436
bool ignorePendingAsyncCreation = false,
437437
});
438438

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
442442
/// is not ready in the given time. The Exception contains details on which Singletons are
443443
/// not ready at that time.
444444
/// [callee] optional parameter which makes debugging easier. Pass `this` in here.
@@ -477,7 +477,7 @@ abstract class GetIt {
477477
/// will complete the future you got from [allReady], so it can be used to globally
478478
/// giving a ready Signal
479479
///
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
481481
/// don't register a singleton to signal ready or use any async registrations
482482
///
483483
/// Or use async registrations methods or let individual instances signal their ready

0 commit comments

Comments
 (0)