-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from baharudin-yusup/hotfix/submit_phone_numbe…
…r_failed Hotfix/submit phone number failed.
- Loading branch information
Showing
25 changed files
with
1,024 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ enum AppFailureCode { | |
autoSignInFailed, | ||
unknown, | ||
permissionFailure, | ||
submitPhoneNumberNoResponse, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
|
||
abstract class SubmitPhoneNumberStatus { | ||
final String phoneNumber; | ||
|
||
SubmitPhoneNumberStatus({required this.phoneNumber}); | ||
} | ||
|
||
class SubmitPhoneNumberStatusNoResponse extends SubmitPhoneNumberStatus { | ||
SubmitPhoneNumberStatusNoResponse(String phoneNumber) | ||
: super(phoneNumber: phoneNumber); | ||
|
||
@override | ||
String toString() { | ||
return 'Submit phone number $phoneNumber no response!'; | ||
} | ||
} | ||
|
||
class CodeSent extends SubmitPhoneNumberStatus { | ||
CodeSent(String phoneNumber) : super(phoneNumber: phoneNumber); | ||
|
||
@override | ||
String toString() { | ||
return 'Code sent for phone number $phoneNumber'; | ||
} | ||
} | ||
|
||
class SubmitPhoneNumberError extends SubmitPhoneNumberStatus { | ||
final FirebaseAuthException? exception; | ||
|
||
SubmitPhoneNumberError(this.exception, {required super.phoneNumber}); | ||
|
||
@override | ||
String toString() { | ||
return 'Submit phone number $phoneNumber error: ${exception?.message}'; | ||
} | ||
} | ||
|
||
class AutoSignIn extends SubmitPhoneNumberStatus { | ||
final User user; | ||
|
||
AutoSignIn(this.user, {required super.phoneNumber}); | ||
|
||
@override | ||
String toString() { | ||
return 'Auto sign in for phone number $phoneNumber success!'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
enum AuthStatus { unauthorized, lastAuthorized, authorized } | ||
enum AuthStatus { unknown, unauthorized, authorized } |
Oops, something went wrong.