Skip to content

Commit da45a9c

Browse files
committed
dialog: Add "Learn more"-button param to showErrorDialog
And reportErrorToUserModally.
1 parent 3ff3bc1 commit da45a9c

14 files changed

+87
-5
lines changed

assets/l10n/app_en.arb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@
447447
"@dialogClose": {
448448
"description": "Button label in dialogs to close."
449449
},
450+
"errorDialogLearnMore": "Learn more",
451+
"@errorDialogLearnMore": {
452+
"description": "Button label in error dialogs to open a web page with more information."
453+
},
450454
"errorDialogContinue": "OK",
451455
"@errorDialogContinue": {
452456
"description": "Button label in error dialogs to acknowledge the error and close the dialog."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,12 @@ abstract class ZulipLocalizations {
693693
/// **'Close'**
694694
String get dialogClose;
695695

696+
/// Button label in error dialogs to open a web page with more information.
697+
///
698+
/// In en, this message translates to:
699+
/// **'Learn more'**
700+
String get errorDialogLearnMore;
701+
696702
/// Button label in error dialogs to acknowledge the error and close the dialog.
697703
///
698704
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
348348
@override
349349
String get dialogClose => 'Close';
350350

351+
@override
352+
String get errorDialogLearnMore => 'Learn more';
353+
351354
@override
352355
String get errorDialogContinue => 'OK';
353356

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
348348
@override
349349
String get dialogClose => 'Close';
350350

351+
@override
352+
String get errorDialogLearnMore => 'Learn more';
353+
351354
@override
352355
String get errorDialogContinue => 'OK';
353356

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
348348
@override
349349
String get dialogClose => 'Close';
350350

351+
@override
352+
String get errorDialogLearnMore => 'Learn more';
353+
351354
@override
352355
String get errorDialogContinue => 'OK';
353356

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
348348
@override
349349
String get dialogClose => 'Close';
350350

351+
@override
352+
String get errorDialogLearnMore => 'Learn more';
353+
351354
@override
352355
String get errorDialogContinue => 'OK';
353356

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
348348
@override
349349
String get dialogClose => 'Zamknij';
350350

351+
@override
352+
String get errorDialogLearnMore => 'Learn more';
353+
351354
@override
352355
String get errorDialogContinue => 'OK';
353356

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
348348
@override
349349
String get dialogClose => 'Закрыть';
350350

351+
@override
352+
String get errorDialogLearnMore => 'Learn more';
353+
351354
@override
352355
String get errorDialogContinue => 'OK';
353356

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
348348
@override
349349
String get dialogClose => 'Zavrieť';
350350

351+
@override
352+
String get errorDialogLearnMore => 'Learn more';
353+
351354
@override
352355
String get errorDialogContinue => 'OK';
353356

lib/log.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ bool debugLog(String message) {
3636
// `null` for the `message` parameter and promptly dismiss the reported errors.
3737
typedef ReportErrorCancellablyCallback = void Function(String? message, {String? details});
3838

39-
typedef ReportErrorCallback = void Function(String title, {String? message});
39+
typedef ReportErrorCallback = void Function(
40+
String title, {
41+
String? message,
42+
Uri? learnMoreButtonUrl,
43+
});
4044

4145
/// Show the user an error message, without requiring them to interact with it.
4246
///
@@ -70,7 +74,11 @@ void defaultReportErrorToUserBriefly(String? message, {String? details}) {
7074
_reportErrorToConsole(message, details);
7175
}
7276

73-
void defaultReportErrorToUserModally(String title, {String? message}) {
77+
void defaultReportErrorToUserModally(
78+
String title, {
79+
String? message,
80+
Uri? learnMoreButtonUrl,
81+
}) {
7482
_reportErrorToConsole(title, message);
7583
}
7684

0 commit comments

Comments
 (0)