NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #264 most downloaded on pub.dev
Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App"
Last release 18 days ago
19 Sep 2026
Release timing varies
gaps range from 8 days to 8 months
Most releases are documented
notes for 53 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
90 releases · first in 2018
Detect circular self-resolution of lazy singletons (sync and async) and cached factories and throw a descriptive StateError instead of a StackOverflow
StateError instead of a StackOverflowError. Thanks to @muhammadkamel (#423).pubspec.lock is no longer committed, following the Dart guidelines for library packages.acceptsParams getter on ObjectRegistration that tells whether the registered factory takes parameters. Passing param1/param2 to a registration that doesn't accept parameters now fails an assert in debug mode instead of silently ignoring them.skipUnregisterIfNotRegistered: when set to true, unregister silently ignores a missing registration instead of throwing (default stays false). Thanks to @Gorniaky (#420) and @AzazelSensei (#424) for raising this.Added AI skill files in skills/ directory for AI coding assistants
One column per quarter.
skills/ directory for AI coding assistantsallReady() now caches its Future and returns the same instance on repeated calls
allReady() now caches its Future and returns the same instance on repeated calls
pushNewScope)unregister() or scope reset, allowing allReady() to complete properlyRemove generated test folder from example
Remove generated test folder from example
Remove gradlew patterns from .gitignore and example/.gitignore to include scripts
toString() output for created instancesdebugEventsEnabled = true to be set on GetIt instanceUpdate workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
Update workflow to trigger on main branch
registrationNumber (a sequential counter assigned during registration) ensuring true LIFO orderstrictDisposalOrder parameter has been removed from reset(), resetScope(), popScope(), popScopesTill(), and dropScope() methodsregisterCachedFactoryParamAsync where calling getAsync would fail with null error because it was checking the wrong function parameter (sync creationFunctionParam instead of asyncCreationFunctionParam)Reduce from 704 to 192 lines following README_TEMPLATE.md
findAll() method for finding all registered instances by type with flexible matching options (subtypes, interfaces, scope filtering)resetLazySingletons() method to reset multiple lazy singletons at once with optional scope parametersonCreated callback parameter to registerLazySingleton, registerLazySingletonAsync, and registerSingletonAsync for lifecycle hooks…has not impact on the public API so it is not a breaking change.
Thanks to PR by @Hu-Wentao we now expose part of the internal state of get_it so tool authors have more options. While doing so internal renaming has happened, so where previously where the term "ServiceFactory" was uses we not use consistently ObjectRegistration and instead of variables with factory in the name we use registration this has not impact on the public API so it is not a breaking change.
dependsOn of registerSingletonWithDependencies is now required. Although this could be seen as a breaking change, if you didn't pass dependsOn your co…
getMaybe which will return null instead of throwing an exception in case a type is not registereddependsOn of registerSingletonWithDependencies is now required. Although this could be seen as a breaking change, if you didn't pass dependsOn your code wouldn't have worked before so I won't define this as breaking changefixing linter warning thanks to @PatrickChrestin
Fixes by @kuhnroyal and @ArtAhmetajCR who spotted some flaws in my latest changes. Thanks a lot
Bugfixes and improvements for certain edge cases thanks to @KnightOfBlackLily and @kuhnroyal
official new release with all the changes
adding cachedFatories and better scope protection against race conditions
testing weak references in lazySingeltons
* adding changeTypeInstanceName
changeTypeInstanceNamefixing bug in unregister that happened if you tried to unregister a named registration by providing an instance instead of the type and the instance n
unregister that happened if you tried to unregister a named registration by providing an instance instead of the type and the instance namereleaseInstance will now throw if the instance isn't registered
fixing negative reference count
getAll() and getAllAsync() now have a fromAllScopes parameter.
getAll() and getAllAsync() now have a fromAllScopes parameter.push/popScope while the init() function of another pushScope is running.thanks to the PR by @kasefuchs https://github.com/fluttercommunity/get_it/pull/361 getAll is now available in an async version too.
getAll is now available in an async version too.fig for bug that was introduced in 7.6.8 https://github.com/fluttercommunity/get_it/issues/358
merged PR by @venkata-reddy-dev https://github.com/fluttercommunity/get_it/pull/356 adding new skipDoubleRegistration flag for testing
skipDoubleRegistration flag for testingmerged PR by @subzero911 https://github.com/fluttercommunity/get_it/pull/330
Thanks to PR by @bvoq getIt.reset, getIt.popScope, getIt.dropScope now dispose registered objects in the reverse order in which they were registered.
getIt.reset, getIt.popScope, getIt.dropScope now dispose registered objects in the reverse order in which they were registered.fixed the throwing of a StateError that was previously thrown as String
push new version because pub didn't list this one
* fix linter error
Nothing published for this version
added isFinal scope parameter which fixes https://github.com/fluttercommunity/get_it/issues/326
isFinal scope parameter which fixes https://github.com/fluttercommunity/get_it/issues/326merged PR by lacopiroty https://github.com/fluttercommunity/get_it/pull/297 which now allows to access objects inside GetIt by runtime type too like `
getIt.registerSingleton(TestClass());
final instance1 = getIt.get(type: TestClass);
expect(instance1 is TestClass, true);
new function dropScope(scopeName) which allows to remove and dispose any named scope even if it's not the top one. Great PR by @olexale https://github
dropScope(scopeName) which allows to remove and dispose any named scope even if it's not the top one. Great PR by @olexale https://github.com/fluttercommunity/get_it/pull/292 which fixes sort of race conditions if you create scopes just for the life time of a widget.PR from @dzziwny which fixed an edge case with LazySingletons https://github.com/fluttercommunity/get_it/pull/284
registerSingleton now returns the passed instance as a return value thanks to the PR by @Rexios80 https://github.com/fluttercommunity/get_it/pull/242
registerSingleton now returns the passed instance as a return value thanks to the PR by @Rexios80 https://github.com/fluttercommunity/get_it/pull/242GetIt.noDebugOutput=true following the PR from @James1345popScopeTil got a new optional inclusive parameter so you can now decide if scope with the passed name should be popped too or only the ones above
New features:
popScopeTil got a new optional inclusive parameter so you can now decide if scope with the passed name should be popped too or only the ones abovesignalReadyfix for https://github.com/fluttercommunity/get_it/issues/210
async to 2.6 againfixed bug with manual synchronization of SingletonsWithDependencies https://github.com/fluttercommunity/get_it/issues/196
Fix for https://github.com/fluttercommunity/get_it/issues/186
Thanks to the clever PR https://github.com/fluttercommunity/get_it/pull/185 by @kmartins unregister and resetLazySingleton now only have to be awaited
unregister and resetLazySingleton now only have to be awaited if you use an async disposal function.pushNewScope() now got an optional init parameter where you can pass a function that registers new objects inside the newly pushed Scope. Doing the re
pushNewScope() now got an optional init parameter where you can pass a function that registers new objects inside the newly pushed Scope. Doing the registration in this function ensures that the onScopeChanged call-back is called after the objects are registered.The new Disposable interface had a typo that now got corrected. You could call this a breaking change but as the last version change is just three day…
Disposable interface had a typo that now got corrected. You could call this a breaking change but as the last version change is just three days old I guess not many people will be affected by this correction.When using scopes with objects that shadow other objects its important to give the UI a chance to rebuild and acquire references to the now active objects. For this you can register an call-back function in GetIt
The getit_mixin has a matching rebuiltOnScopeChange method.
/// Optional call-back that will get call whenever a change in the current scope happens
/// This can be very helpful to update the UI in such a case to make sure it uses
/// the correct Objects after a scope change
void Function(bool pushed)? onScopeChanged;
This is a breaking change because there were some inconsistencies in the handling of the disposal functions that you can pass when registering an Obje…
This is a breaking change because there were some inconsistencies in the handling of the disposal functions that you can pass when registering an Object, pop a Scope or use unregister() resetLazySingleton(). Some of accepted a FutureOr method type, others just a void which meant you couldn't use async functions consistently. With this release you can use async functions in all disposal functions which unfortunately also required to change the signatures of the following functions:
Future<void> reset({bool dispose = true});
Future<void> resetScope({bool dispose = true});
Future<void> popScope();
Future<bool> popScopesTill(String name);
FutureOr resetLazySingleton<T extends Object>({
Object? instance,
String? instanceName,
FutureOr Function(T)? disposingFunction,
});
FutureOr unregister<T extends Object>({
Object? instance,
String? instanceName,
FutureOr Function(T)? disposingFunction,
});
Basically all functions that can possibly call a disposal functions should be awaited.
Disposable interfaceInstead of passing a disposing function on registration or when pushing a Scope from V7.0 on your objects onDispose() method will be called
if the object that you register implements the Disposable´interface:
abstract class Disposable {
FutureOr onDispose();
}
In some cases it might be helpful to know if an Object gets shadowed by another one e.g. if it has some Stream subscriptions that it want to cancel before the shadowing object creates a new subscription. Also the other way round so that a shadowed Object gets notified when it's "active" again meaning when a shadowing object is removed.
For this a class had to implement the ShadowChangeHandlers interface:
abstract class ShadowChangeHandlers {
void onGetShadowed(Object shadowing);
void onLeaveShadow(Object shadowing);
}
When the Object is shadowed its onGetShadowed() method is called with the object that is shadowing it. When this object is removed from GetIt onLeaveShadow() will be called.
small fix in getAsync with parameters
Exceptions that occur during an async initialisation are now forwarded to the future that allReady() returns instead to get swallowed https://github.c
allReady() returns instead to get swallowed https://github.com/fluttercommunity/get_it/issues/148currentScopeName to query the name of the currently active scope https://github.com/fluttercommunity/get_it/issues/153popScope will know throw an Exception instead just an assert if you are already on the baseScope and you try to pop it.* Official null safety release
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
fixed https://github.com/fluttercommunity/get_it/issues/138 when calling unRegister the dispose function that can be passed when registering wasn't ca
unRegister the dispose function
that can be passed when registering wasn't called.* fixed formatting in readme
Breaking change: reset() now is async and returns a Future because it will call the new optional disposal functions that can be async
reset() now is async and returns a Future because it will call the new optional disposal functions that can be async* experimental
Your coding agent can read these notes before it upgrades. Set up the MCP server →