@@ -31,7 +31,8 @@ bool debugLog(String message) {
3131 return true ;
3232}
3333
34- typedef ReportErrorCallback = void Function (String ? message, {String ? details});
34+ typedef ReportErrorCancellablyCallback = void Function (String ? message, {String ? details});
35+ typedef ReportErrorCallback = void Function (String message, {String ? details});
3536
3637/// Show the user an error message, without requiring them to interact with it.
3738///
@@ -48,7 +49,18 @@ typedef ReportErrorCallback = void Function(String? message, {String? details});
4849// This gets set in [ZulipApp]. We need this indirection to keep `lib/log.dart`
4950// from importing widget code, because the file is a dependency for the rest of
5051// the app.
51- ReportErrorCallback reportErrorToUserBriefly = defaultReportErrorToUserBriefly;
52+ ReportErrorCancellablyCallback reportErrorToUserBriefly = defaultReportErrorToUserBriefly;
53+
54+ /// Show the user a dismissable error message in a modal popup.
55+ ///
56+ /// Typically this shows a [AlertDialog] containing the message.
57+ /// If called before the app's widget tree is ready (see [ZulipApp.ready] ),
58+ /// then we give up on showing the message to the user,
59+ /// and just log the message to the console.
60+ // This gets set in [ZulipApp]. We need this indirection to keep `lib/log.dart`
61+ // from importing widget code, because the file is a dependency for the rest of
62+ // the app.
63+ ReportErrorCallback reportErrorToUserModally = defaultReportErrorToUserBriefly;
5264
5365void defaultReportErrorToUserBriefly (String ? message, {String ? details}) {
5466 // Error dismissing is a no-op to the default handler.
0 commit comments