Skip to content

it say does not registered but it registered successfully #274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mostafasaadamin opened this issue Apr 26, 2022 · 2 comments
Closed

it say does not registered but it registered successfully #274

mostafasaadamin opened this issue Apr 26, 2022 · 2 comments

Comments

@mostafasaadamin
Copy link

Object/factory with type TokenLocalRepository is not registered inside GetIt.
(Did you accidentally do GetIt sl=GetIt.instance(); instead of GetIt sl=GetIt.instance;
Did you forget to register it?)
'package:get_it/get_it_impl.dart':
Failed assertion: line 372 pos 7: 'instanceFactory != null'

`Future init() async {
getIt.registerLazySingleton(() => CompanyUrls(
storeKeeperUrl: "",
personnelUrl: "",
tokenEndPoint: "",
miscUrl: "",
domain: "",
apiUrl: ""));
getIt.registerLazySingleton(() => AppLanguage());
getIt.registerLazySingleton(() => Daily());
getIt.registerLazySingleton(() => PointOfSale());
getIt.registerLazySingleton(() => User());
getIt.registerLazySingleton(() => ConnectionServices());
getIt.registerLazySingleton(() => AlerterMessage());
getIt.registerLazySingleton(() => PrinterLocalRepository());
getIt.registerLazySingleton(() => TokenLocalRepository());
getIt.registerLazySingleton(() => UrlsLocalRepository());
getIt.registerLazySingleton(() => UserLocalRepository());
getIt.registerLazySingleton(() => TokenRepository(language: getIt(), companyUrls: getIt()));
getIt.registerLazySingleton(() => CompanyUrlsData(client: getIt()));
getIt.registerLazySingleton(() => UserRepository(client: getIt()));
getIt.registerLazySingleton(() => TokenService(tokenLocalRepository: getIt(),tokenRepository: getIt()));
getIt.registerLazySingleton(() => RequestProvider(
companyUrls: getIt(), language: getIt(), tokenService: getIt()));
getIt.registerFactory(() => SplashViewModel(
language: getIt(),
companyUrls: getIt(),
userLocalRepository: getIt(),
user: getIt(),
urlsLocalRepository: getIt(),
tokenLocalRepository: getIt(),
printerLocalRepository: getIt()));
getIt.registerFactory(() => CodeViewModel(
connectionService:getIt(),
companyUrls: getIt(),
urlsRepository:getIt(),

  messageService:getIt(),
  urlsLocalRepository: getIt(),));

}`

@omerrciftcii
Copy link

Also I have same issue and looking the answers almost 2 days.

@escamoteur
Copy link
Collaborator

Sorry for the late response, I had to take a longer break due to health issues. If you still have a problem, please open a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants