signInAnonymously static method
Future<User?>
signInAnonymously(
- BuildContext context, {
- dynamic onSignInSuccessful(
- User?
- dynamic onError()?,
Initiates and Anonymous SignIn and the AuthManager changes the screen to the destinationFragment
Enable Anonymous Authentication in your Firebase Authentication Console for this to work
context
is neccessary
onSignInSuccessful
a Callback to perform any action after a successful SignIn
Implementation
static Future<User?> signInAnonymously(
BuildContext context, {
Function(User?)? onSignInSuccessful,
Function(String)? onError,
}) async {
return await Provider.of<FireAuthProvider>(
context,
listen: false,
).signInAnonymously(
onSignInSuccessful: onSignInSuccessful,
onError: onError,
);
}