catchError method
Catch and explicitly handle the error.
Implementation
void catchError(Exception? ex) {
if (ex == null) {
return;
}
/// If a tester is running. Don't handle the error.
if (WidgetsBinding.instance is WidgetsFlutterBinding) {
FlutterError.onError!(FlutterErrorDetails(exception: ex));
}
}