setup static method

Future<void> setup({
  1. List<HummErrorTracker>? trackers,
  2. String? storageKey,
  3. HummErrorStorage? errorStorage,
  4. ErrorDisplayCallback? errorDisplayCallback,
  5. ErrorTranslationCallback? errorTranslationCallback,
  6. bool shouldDisplayErrorCallback(
    1. dynamic error,
    2. StackTrace stackTrace
    )?,
  7. String? defaultErrorMessage,
  8. int? logSize,
})

Implementation

static Future<void> setup({
  List<HummErrorTracker>? trackers,
  String? storageKey,
  HummErrorStorage? errorStorage,
  ErrorDisplayCallback? errorDisplayCallback,
  ErrorTranslationCallback? errorTranslationCallback,
  bool Function(dynamic error, StackTrace stackTrace)? shouldDisplayErrorCallback,
  String? defaultErrorMessage,
  int? logSize,
}) async {
  final handler = HummErrorHandler();
  await handler.init(
    storageKey: storageKey,
    errorStorage: errorStorage,
    trackers: trackers,
    errorDisplayCallback: errorDisplayCallback,
    errorTranslationCallback: errorTranslationCallback,
    shouldDisplayErrorCallback: shouldDisplayErrorCallback,
    defaultErrorMessage: defaultErrorMessage,
    logSize: logSize,
  );

  // Configure Flutter error handling
  handler.setupFlutterErrorHandling();
}