LogInWithGoogleFailure.fromCode constructor
LogInWithGoogleFailure.fromCode(
- String code
Create an authentication message from a firebase authentication exception code.
Implementation
factory LogInWithGoogleFailure.fromCode(String code) {
switch (code) {
case 'account-exists-with-different-credential':
return LogInWithGoogleFailure(
code,
'Account exists with different credentials.',
);
case 'invalid-credential':
return LogInWithGoogleFailure(
code,
'The credential received is malformed or has expired.',
);
case 'operation-not-allowed':
return LogInWithGoogleFailure(
code,
'Operation is not allowed. Please contact support.',
);
case 'user-disabled':
return LogInWithGoogleFailure(
code,
'This user has been disabled. Please contact support for help.',
);
case 'user-not-found':
return LogInWithGoogleFailure(
code,
'Email is not found, please create an account.',
);
case 'wrong-password':
return LogInWithGoogleFailure(
code,
'Incorrect password, please try again.',
);
case 'invalid-verification-code':
return LogInWithGoogleFailure(
code,
'The credential verification code received is invalid.',
);
case 'invalid-verification-id':
return LogInWithGoogleFailure(
code,
'The credential verification ID received is invalid.',
);
case 'invalid-phone-number':
return LogInWithGoogleFailure(
code,
'The provided phone number is not valid',
);
default:
return LogInWithGoogleFailure(code);
}
}