mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 11:12:23 +01:00
24 lines
729 B
Dart
24 lines
729 B
Dart
import 'package:fluent_ui/fluent_ui.dart';
|
|
|
|
import '../../../main.dart';
|
|
import '../ui/dialog/dialog.dart';
|
|
|
|
void onError(Object? exception, StackTrace? stackTrace, bool framework) {
|
|
if(exception == null){
|
|
return;
|
|
}
|
|
|
|
if(appKey.currentContext == null || appKey.currentState?.mounted == false){
|
|
return;
|
|
}
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) => 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"
|
|
)
|
|
));
|
|
} |