Ignore UI issues from exceptions report
OmarHatem committed
Jan 9, 2023 at 20:03 UTC
8d68ccfc7b0a3a7491d3665da798c9b41c21e4a9
1 file changed
+6
-3
lib/main.dart
+6
-3
@@ -57,7 +57,10 @@ Future<void> main() async {
57
WidgetsFlutterBinding.ensureInitialized();
58
59
FlutterError.onError = (errorDetails) {
60
- _onError(errorDetails);
60
+ // if not a UI error
61
+ if (errorDetails.library != "widgets library") {
62
+ _onError(errorDetails);
63
+ }
64
};
65
66
/// A callback that is invoked when an unhandled error occurs in the root
@@ -193,8 +196,8 @@ void _sendExceptionFile() async {
196
197
final result = await FlutterMailer.send(mailOptions);
198
196
- // clear file content if the error was sent or saved
197
- // on android we can't know if it was sent or saved
199
+ // Clear file content if the error was sent or saved.
200
+ // On android we can't know if it was sent or saved
201
if (result.name == MailerResponse.sent.name ||
202
result.name == MailerResponse.saved.name ||
203
result.name == MailerResponse.android.name) {