ChartErrorReporter class abstract

Abstract interface for error reporting services.

Implement this to integrate with crash reporting services like Sentry, Crashlytics, or custom error tracking systems.

Example:

class SentryErrorReporter extends ChartErrorReporter {
  @override
  Future<void> report(ErrorReport report) async {
    await Sentry.captureException(
      report.error,
      stackTrace: report.stackTrace,
      hint: Hint.withMap(report.context?.toJson() ?? {}),
    );
  }
}

// Set as global reporter
ChartErrorReporter.instance = SentryErrorReporter();
Implementers

Constructors

ChartErrorReporter()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
report(ErrorReport report) FutureOr<void>
Reports an error.
reportChartException(ChartException exception, {StackTrace? stackTrace, ErrorContext? context, bool isFatal = false}) FutureOr<void>
Reports a chart exception.
reportError(Object error, {StackTrace? stackTrace, ErrorSeverity severity = ErrorSeverity.medium, ErrorContext? context, List<String>? tags, bool isFatal = false}) FutureOr<void>
Convenience method to report an error with context.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance ChartErrorReporter
The current global error reporter instance.
getter/setter pair