Skip to content

Commit aa34d23

Browse files
committed
fix: double registring get_it
1 parent 669dbe0 commit aa34d23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/src/logic/trent_manager.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ final GetIt _serviceLocator = GetIt.instance;
1010
ChangeNotifierProvider register<T extends ChangeNotifier>(
1111
T trent,
1212
) {
13-
_serviceLocator.registerSingleton<T>(trent);
13+
if (!_serviceLocator.isRegistered<T>()) {
14+
_serviceLocator.registerSingleton<T>(trent);
15+
}
1416
return ChangeNotifierProvider<T>(
1517
create: (_) => _serviceLocator.get<T>(),
1618
);

0 commit comments

Comments
 (0)