BugReportClient class

Central orchestrator for the bug reporting system (v2).

  • Initializes configuration and reporter pipeline
  • Collects context (built-in + app-provided)
  • Applies transforms and sanitizers
  • Enforces policy (severity, sampling, dedupe, rate-limit)
  • Persists to a durable outbox when delivery fails

Properties

hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
Indicates whether initialize has been called.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBreadcrumb(String message, {Map<String, dynamic> data = const {}, DateTime? timestamp}) → void
Adds a breadcrumb to the ring buffer, keeping only the most recent _maxBreadcrumbs.
addContextProvider(ContextProvider provider) → void
Adds a runtime context provider (e.g., current user/session). This supplements ClientConfig.additionalProviders.
capture(BaseException exception, {Map<String, dynamic> additionalContext = const {}, bool manual = false, bool handled = true}) Future<ReportEvent>
Convenience method to capture and report an exception directly.
captureSafely(BaseException exception, {Map<String, dynamic> additionalContext = const {}, bool manual = false, bool handled = true}) Future<void>
Captures and reports exception without ever throwing.
clearBreadcrumbs() → void
Clears all breadcrumbs currently buffered.
clearContextProviders() → void
Clears all runtime context providers.
createEvent(BaseException exception, {Map<String, dynamic> additionalContext = const {}, bool manual = false, bool handled = true}) Future<ReportEvent>
Creates a ReportEvent from a BaseException, collecting and merging contexts, applying transforms and sanitizers, and returning a sanitized event ready for delivery.
flush() Future<void>
Flushes any events persisted in the outbox.
initialize(ClientConfig config) Future<void>
Initialize the client with the given config. This must be called once during application bootstrap.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeContextProvider(ContextProvider provider) → void
Removes a previously added runtime context provider.
report(ReportEvent event) Future<bool>
Reports (delivers) a pre-built ReportEvent via the configured pipeline, respecting policy. Returns true if at least one reporter successfully delivered the event.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance BugReportClient
Global singleton used across the app to coordinate reporting.
final