Commit ab89f5c
authored
feat(ui_auth): export
When `ErrorText.localizeError` is used, it becomes a single source of truth.
This means all error messages should be localized by developer.
A subset of errors is already localized by Firebase UI, so `localizedErrorText` that is
used internally is now public and could be used inside `ErrorText.localizeError`.
Example:
```dart
ErrorText.localizeError = (BuildContext context, FirebaseAuthException e) {
if (e.code == "user-not-found" || e.code == "wrong-password") return "Wrong credentials";
final defaultLabels = FirebaseUILocalizations.labelsOf(context);
return localizedErrorText(e.code, defaultLabels);
}
```localizedErrorText (#189)1 parent e85c516 commit ab89f5c
File tree
2 files changed
+5
-3
lines changed- packages/firebase_ui_auth/lib
- src/widgets
2 files changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
0 commit comments