AnalyticsError.error constructor

AnalyticsError.error(
  1. FlutterErrorDetails details
)

Creates an error report from a FlutterErrorDetails object.

Implementation

factory AnalyticsError.error(FlutterErrorDetails details) {
  return AnalyticsError(
    platform: _platform,
    time: DateTime.now().toIso8601String(),
    msg: details.exception.toString(),
    details: details.exceptionAsString(),
    sign: details.exception is AssertionError
        ? "๐Ÿงจ"
        : details.exception is Exception || details.exception is Error
            ? "๐Ÿšจ"
            : "๐Ÿ’ฅ",
    type: details.exception is AssertionError
        ? AnalyticsErrorType.assertion
        : AnalyticsErrorType.widget,
  );
}