Skip to content

registered FlutterLocalNotificationsPlugin give me error #96

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
akoua opened this issue Jul 19, 2020 · 3 comments
Closed

registered FlutterLocalNotificationsPlugin give me error #96

akoua opened this issue Jul 19, 2020 · 3 comments

Comments

@akoua
Copy link

akoua commented Jul 19, 2020

When I register FlutterLocalNotificationsPlugin like this slL.registerLazySingleton<FlutterLocalNotificationsPlugin>( () => FlutterLocalNotificationsPlugin());, and want to call his show() method it's give me error like this:

I/flutter ( 7792): 'package:get_it/get_it_impl.dart': Failed assertion: line 251 pos 14: 'instanceFactory != null': No type FlutterLocalNotificationsPlugin is registered inside GetIt. I/flutter ( 7792): Did you forget to pass an instance name? I/flutter ( 7792): (Did you accidentally do GetIt sl=GetIt.instance(); instead of GetIt sl=GetIt.instance;did you forget to register it?)

But when I create an instance of FlutterLocalNotificationsPlugin and register an instance of FlutterLocalNotificationsPlugin with GetIt, there are the same hashcode

@escamoteur
Copy link
Collaborator

Can you show me the code where you register and where you call the show method?

@akoua
Copy link
Author

akoua commented Jul 27, 2020

I can't give anymore informations. But I register that slL.registerLazySingleton<FlutterLocalNotificationsPlugin>( () => FlutterLocalNotificationsPlugin()); and call it slL<FlutterLocalNotificationsPlugin>()

@escamoteur
Copy link
Collaborator

That is pretty strange because it's basically what GetIt is designed to do.
could you create a small repro project and put it on GitHub please?

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

2 participants