0.Introduction
Have you ever wanted to implement user authentication in your flutter Application? Well, you've come to the right place.....
For further actions, you may consider blocking this person and/or reporting abuse
Sir, first time the program is run without error. Bt second time I open this app show error In home screen. Invalid arguments. What to do??
Hey Nikhil, thank you for noticing and pointing out the error. (fixed error now)
Cause for error : When the user enters home screen second time it fails to retrieve the name,imageUrl some other details because we haven't stored user details globally.
Anyway, I've fixed the issue and updated the article.
If you found this article useful sharing is highly appreciated. Twitter : @movingmelody :)
Sir how to resolve these error. Becz I'm beginner in Flutter.
I've updated the code in the article or you can find the code in GitHub repo. Go through the code again. Your error will solve.
Ok sir.
Still, If you find any issues comment the error. And let me know if error is solved
Invalid argument(s)
The relevant error-causing widget was
HomeScreen
lib\screens\authscreen.dart:79
When the exception was thrown, this was the stack
0 _StringBase.+ (dart:core-patch/string_patch.dart:262:57)
1 _HomeScreenState.build
package:firebase_gsignin/screens/homescreen.dart:17
2 StatefulElement.build
package:flutter/β¦/widgets/framework.dart:4619
3 ComponentElement.performRebuild
package:flutter/β¦/widgets/framework.dart:4502
4 StatefulElement.performRebuild
Sir kindly help
Check the updated code and article
Were you able to find a solution to this? I'm having the same problem right now. :/
Actually, that was because the null value is passed to the homescreen from the splashscreen(username). Fixed β β the error now. You can update the code as i updated the article.
Or else simply store the user details in localstorage using the SharedPreferences. It enables you to access the details even in offline mode.
I have commited the new changes to github. If you stuck anywhere look over github repo.
Hello Sir, last time the program is run Perfectly. Bt now in AuthScreen
=> Error in following lines
1) final AuthResult authResult = await auth.signInWithCredential(credential);
2) final FirebaseUser currentUser = await auth.currentUser();
assert(firebaseUser.uid == currentUser.uid);
return firebaseUser;
& in Splash Screen has returned error.
=> Error in following lines
1) FirebaseAuth.instance.currentUser().then((currentUser) {
if (currentUser == null) {
Timer(Duration(seconds: 2),
() => Navigator.pushReplacementNamed(context, "/auth"));
} else {
Timer(
Duration(seconds: 2),
() => Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (context) =>
HomeScreen(username: currentUser.displayName)),
(Route route) => false),
);
}
});
What to do, please help me to find these issue??
Sir, how to call username, imageUrl and Email in another page ?
I have a problem when i close my app ,then error
Store the user details locally in your phone using SharedPreferences when user signup. Then simply retrieve the user details in the page you want to use them. Additionally it enables offline access π¦ΈββοΈ