This commit is contained in:
Alessandro Autiero
2022-12-16 21:08:57 +01:00
parent ef7f34e0e3
commit 966b4b33fd
91 changed files with 388682 additions and 1005 deletions

24
lib/src/util/error.dart Normal file
View File

@@ -0,0 +1,24 @@
import 'package:fluent_ui/fluent_ui.dart';
import '../../main.dart';
import '../dialog/dialog.dart';
void onError(Object? exception, StackTrace? stackTrace, bool framework) {
if(exception == null){
return;
}
if(appKey.currentContext == null || appKey.currentState?.mounted == false){
return;
}
showDialog(
context: appKey.currentContext!,
builder: (context) =>
ErrorDialog(
exception: exception,
stackTrace: stackTrace,
errorMessageBuilder: (exception) => framework ? "An error was thrown by Flutter: $exception" : "An uncaught error was thrown: $exception"
)
);
}