class SignUpWithEmailAndPasswordFailure { final String message; const SignUpWithEmailAndPasswordFailure( [this.message = "An Unknown error ocurred."]); factory SignUpWithEmailAndPasswordFailure.code(String code) { switch (code) { case 'weak-password': return const SignUpWithEmailAndPasswordFailure( 'Please enter a stronger password.'); case 'email-alredy-in-use': return const SignUpWithEmailAndPasswordFailure( 'An account alredy exists for that email.'); default: return const SignUpWithEmailAndPasswordFailure(); } } }