@@ -91,20 +91,25 @@ void main() async {
91
91
await PreferenceHelper .instance.migrationSupportFunctionForSharedPreferences ();
92
92
93
93
// Catch errors from Flutter itself (widget build, layout, paint, etc.)
94
- // FlutterError.onError = (FlutterErrorDetails details) {
95
- // final stack = details.stack ?? StackTrace.empty;
96
- // if (kDebugMode) {
97
- // FlutterError.dumpErrorToConsole(details);
98
- // }
99
94
//
100
- // // Don't show the full error dialog for network image loading errors.
101
- // if (details.exception is NetworkImageLoadException) {
102
- // return;
103
- // }
104
- //
105
- // // showGeneralErrorDialog(details.exception, stack);
106
- // // throw details.exception;
107
- // };
95
+ // NOTE: it seems this sometimes makes problems and even freezes the flutter
96
+ // process when widgets overflow, so it is disabled in dev mode.
97
+ if (kReleaseMode) {
98
+ FlutterError .onError = (FlutterErrorDetails details) {
99
+ final stack = details.stack ?? StackTrace .empty;
100
+ // if (kDebugMode) {
101
+ // FlutterError.dumpErrorToConsole(details);
102
+ // }
103
+
104
+ // Don't show the full error dialog for network image loading errors.
105
+ if (details.exception is NetworkImageLoadException ) {
106
+ return ;
107
+ }
108
+
109
+ showGeneralErrorDialog (details.exception, stack);
110
+ // throw details.exception;
111
+ };
112
+ }
108
113
109
114
// Catch errors that happen outside of the Flutter framework (e.g., in async operations)
110
115
PlatformDispatcher .instance.onError = (error, stack) {
0 commit comments