File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,12 @@ bool debugLog(String message) {
33
33
34
34
typedef ReportErrorCallback = void Function (String ? message, {String ? details});
35
35
36
- /// Display an error message in a [SnackBar] .
36
+ /// Show the user an error message, without requiring them to interact with it .
37
37
///
38
- /// This shows a [SnackBar] containing the message if [ZulipApp] is ready,
39
- /// otherwise logs it to the console.
38
+ /// Typically this shows a [SnackBar] containing the message.
39
+ /// If called before the app's widget tree is ready (see [ZulipApp.ready] ),
40
+ /// then we give up on showing the message to the user,
41
+ /// and just log the message to the console.
40
42
///
41
43
/// If `message` is null, this will clear the existing [SnackBar] s if there
42
44
/// are any. Useful for promptly dismissing errors.
Original file line number Diff line number Diff line change @@ -98,13 +98,14 @@ class ZulipApp extends StatefulWidget {
98
98
99
99
static int _snackBarCount = 0 ;
100
100
101
+ /// The callback we normally use as [reportErrorToUserBriefly] .
101
102
static void _reportErrorToUserBriefly (String ? message, {String ? details}) {
102
103
assert (_ready.value);
103
104
104
105
if (message == null ) {
105
106
if (_snackBarCount == 0 ) return ;
106
107
assert (_snackBarCount > 0 );
107
- // The snack bar API only exposes ways to hide ether the current snack
108
+ // The [SnackBar] API only exposes ways to hide ether the current snack
108
109
// bar or all of them.
109
110
//
110
111
// To reduce the possibility of hiding snack bars not created by this
You can’t perform that action at this time.
0 commit comments