Skip to content
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

Non-nullable instance field 'user' must be initialized. Try adding an initializer expression, or a generative constructor that initializes it, or mark it #3

Open
vedantbahel opened this issue Nov 17, 2021 · 1 comment

Comments

@vedantbahel
Copy link

I tried implementing the same but it gives me error:
"Non-nullable instance field 'user' must be initialized.
Try adding an initializer expression, or a generative constructor that initializes it, or mark it"

for

User user;
Timer timer;

And if I further do

User? user;
Timer? timer;

then it throw exception
No implementation found for method Auth#registerIdTokenListener on channel plugins.flutter.io/firebase_auth

@mebo1yt
Copy link

mebo1yt commented Oct 23, 2022

you must add late because you will give this a value later

late User user;
late Timer timer;

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