logErrorDetails method

void logErrorDetails(
  1. FlutterErrorDetails details, {
  2. bool? force,
})

Logs 'every' error as the error count is reset. force - Forces the log despite flag setting of logStateXError

Implementation

void logErrorDetails(FlutterErrorDetails details, {bool? force}) {
  //
  if (logStateXError || (force ?? false)) {
    // Don't when in DebugMode.
    if (!kDebugMode) {
      // Resets the count of errors to show a complete error message not an abbreviated one.
      FlutterError.resetErrorCount();
    }
    // https://docs.flutter.dev/testing/errors#errors-caught-by-flutter
    // Log the error.
    FlutterError.presentError(details);
  } else {
    // Won't log this time with this call.
    logStateXError = true; // Next time.
  }
}