setCrashHandler static method

void setCrashHandler()

Implementation

static void setCrashHandler() {
  // Normal flutter exceptions are captured by this method
  FlutterError.onError = (FlutterErrorDetails details) {
    reportErrorToVwoInsights(
        Constants.errorTypeFlutter, details.stack?.toString());
  };

  // Anything (async, etc) that are not caught by the flutter framework
  // flutter refers to them as isolates
  PlatformDispatcher.instance.onError = (error, stack) {
    reportErrorToVwoInsights(Constants.errorTypePlatform, stack.toString());
    return false;
  };
}