HbErrorReport class

A utility class for handling and reporting errors in Flutter applications.

This class provides a comprehensive error handling solution by:

  1. Capturing uncaught asynchronous errors using custom Zone
  2. Intercepting Flutter's synchronous errors
  3. Providing a mechanism to report errors to external services

Usage:

void main() {
 final errorReport = HbErrorReport(
  reportError: (error, stackTrace) {
    // Send error to your analytics service
  }
 );
 // Run the app within the error-handling zone
  errorReport.errorHandlingZone.run(()  {
    runApp(const MyApp());
  });
}

Constructors

HbErrorReport({void reportError(Object error, StackTrace? stackTrace)?})

Properties

errorHandlingZone Zone
latefinal
hashCode int
The hash code for this object.
no setterinherited
reportError → void Function(Object error, StackTrace? stackTrace)?
final
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
toString() String
A string representation of this object.
inherited

Operators

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