Upgrading get_it 5 to 6
Breaking5.0.6 → 6.1.1Breaking1New1Changed1Fixed2
BreakingUpgrade verdict
1 breaking change.
In plain terms
- Trying to remove the base scope now raises a real error that stays in release builds, not just a debug-only check.
Must act 1 item needs code or config changes
Dart SDK requirement changed in 6.1.0: >=2.1.0 < 3.0.0 → >=2.12.0 <3.0.0.
What you must change
Breaking1
popScope now throws an Exception instead of just an assert when popping the baseScope.
popScopebaseScopeAPI changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- changed:
ctor WaitingTimeOutException(this.areWaitedBy, this.notReadyYet, this.areReady) → ctor WaitingTimeOutException( this.areWaitedBy, this.notReadyYet, this.areReady, ) - changed:
method GetIt.allReady( {Duration timeout, bool ignorePendingAsyncCreation = …}): Future<void> → method GetIt.allReady({ Duration? timeout, bool ignorePendingAsyncCreation = …, }): Future<void> - changed:
method GetIt.call<T>({String instanceName, dynamic param1, dynamic param2}): T → method GetIt.call<T extends Object>({ String? instanceName, dynamic param1, dynamic param2, }): T - changed:
method GetIt.get<T>({String instanceName, dynamic param1, dynamic param2}): T → method GetIt.get<T extends Object>({ String? instanceName, dynamic param1, dynamic param2, }): T - changed:
method GetIt.getAsync<T>({String instanceName, dynamic param1, dynamic param2}): Future<T> → method GetIt.getAsync<T extends Object>({ String? instanceName, dynamic param1, dynamic param2, }): Future<T> - changed:
method GetIt.isReady<T>({ Object instance, String instanceName, Duration timeout, Object callee, }): Future<void> → method GetIt.isReady<T extends Object>({ Object? instance, String? instanceName, Duration? timeout, Object? callee, }): Future<void> - changed:
method GetIt.isReadySync<T>({Object instance, String instanceName}): bool → method GetIt.isReadySync<T extends Object>({ Object? instance, String? instanceName, }): bool - changed:
method GetIt.isRegistered<T>({Object instance, String instanceName}): bool → method GetIt.isRegistered<T extends Object>({Object? instance, String? instanceName}): bool - changed:
method GetIt.pushNewScope({String scopeName, ScopeDisposeFunc dispose}): void → method GetIt.pushNewScope({ String? scopeName, ScopeDisposeFunc? dispose, }): void - changed:
method GetIt.registerFactory<T>(FactoryFunc<T> factoryfunc, {String instanceName}): void → method GetIt.registerFactory<T extends Object>( FactoryFunc<T> factoryFunc, { String? instanceName, }): void - changed:
method GetIt.registerFactoryAsync<T>(FactoryFuncAsync<T> factoryfunc, {String instanceName}): void → method GetIt.registerFactoryAsync<T extends Object>( FactoryFuncAsync<T> factoryFunc, { String? instanceName, }): void - changed:
method GetIt.registerFactoryParam<T, P1, P2>(FactoryFuncParam<T, P1, P2> factoryfunc, {String instanceName}): void → method GetIt.registerFactoryParam<T extends Object, P1, P2>( FactoryFuncParam<T, P1?, P2?> factoryFunc, { String? instanceName, }): void - changed:
method GetIt.registerFactoryParamAsync<T, P1, P2>( FactoryFuncParamAsync<T, P1, P2> factoryfunc, {String instanceName}): void → method GetIt.registerFactoryParamAsync<T extends Object, P1, P2>( FactoryFuncParamAsync<T, P1?, P2?> factoryFunc, { String? instanceName, }): void - changed:
method GetIt.registerLazySingleton<T>(FactoryFunc<T> factoryfunc, {String instanceName, DisposingFunc<T> dispose}): void → method GetIt.registerLazySingleton<T extends Object>( FactoryFunc<T> factoryFunc, { String? instanceName, DisposingFunc<T>? dispose, }): void - changed:
method GetIt.registerLazySingletonAsync<T>(FactoryFuncAsync<T> factoryFunc, {String instanceName, DisposingFunc<T> dispose}): void → method GetIt.registerLazySingletonAsync<T extends Object>( FactoryFuncAsync<T> factoryFunc, { String? instanceName, DisposingFunc<T>? dispose, }): void - changed:
method GetIt.registerSingleton<T>(T instance, {String instanceName, bool signalsReady, DisposingFunc<T> dispose}): void → method GetIt.registerSingleton<T extends Object>( T instance, { String? instanceName, bool? signalsReady, DisposingFunc<T>? dispose, }): void - changed:
method GetIt.registerSingletonAsync<T>(FactoryFuncAsync<T> factoryfunc, {String instanceName, Iterable<Type> dependsOn, bool signalsReady, DisposingFunc<T> dispose}): void → method GetIt.registerSingletonAsync<T extends Object>( FactoryFuncAsync<T> factoryFunc, { String? instanceName, Iterable<Type>? dependsOn, bool? signalsReady, DisposingFunc<T>? dispose, }): void - changed:
method GetIt.registerSingletonWithDependencies<T>(FactoryFunc<T> factoryFunc, {String instanceName, Iterable<Type> dependsOn, bool signalsReady, DisposingFunc<T> dispose}): void → method GetIt.registerSingletonWithDependencies<T extends Object>( FactoryFunc<T> factoryFunc, { String? instanceName, Iterable<Type>? dependsOn, bool? signalsReady, DisposingFunc<T>? dispose, }): void - changed:
method GetIt.resetLazySingleton<T>( {Object instance, String instanceName, void Function(T) disposingFunction}): void → method GetIt.resetLazySingleton<T extends Object>({ Object? instance, String? instanceName, void Function(T)? disposingFunction, }): void - changed:
method GetIt.signalReady(Object instance): void → method GetIt.signalReady(Object? instance): void - changed:
method GetIt.unregister<T>( {Object instance, String instanceName, void Function(T) disposingFunction}): void → method GetIt.unregister<T extends Object>({ Object? instance, String? instanceName, void Function(T)? disposingFunction, }): void - changed:
typedef FactoryFuncParam<T, P1, P2> = T Function(P1 param1, P2 param2) → typedef FactoryFuncParam<T, P1, P2> = T Function( P1 param1, P2 param2, ) - changed:
typedef FactoryFuncParamAsync<T, P1, P2> = Future<T> Function( P1 param1, P2 param2) → typedef FactoryFuncParamAsync<T, P1, P2> = Future<T> Function( P1 param1, P2 param2, ) - added:
get GetIt.currentScopeName: String?