handleException method
Handle the Exception
Implementation
bool handleException(FlutterErrorDetails details) {
// ignore: prefer_final_locals
var handled = false;
//
if (details.exceptionAsString().contains('Zone mismatch.')) {
//
handled = true;
details = FlutterErrorDetails(
exception: details.exception,
stack: details.stack,
library: 'run_app.dart',
context: ErrorHint(
"with unnecessary call for binding.\nPlease remove call, WidgetsFlutterBinding.ensureInitialized();\nIf still required, please set the 'runZoneGuard' parameter to false: runApp(runZoneGuard: false)",
),
informationCollector: details.informationCollector,
);
}
// Log the error
logErrorDetails(details);
return handled;
}