fatal static method

Future<void> fatal(
  1. String message, {
  2. Object? error,
  3. StackTrace? stackTrace,
  4. String? category,
  5. String? tag,
  6. Map<String, dynamic>? metadata,
  7. bool shouldNotify = false,
})

Implementation

static Future<void> fatal(String message, {Object? error, StackTrace? stackTrace, String? category, String? tag, Map<String, dynamic>? metadata, bool shouldNotify = false}) async {
  if (!instance._initialized) {
    throw StateError('VooLogger must be initialized before use');
  }
  await instance._repository.fatal(message, error: error, stackTrace: stackTrace, category: category, tag: tag, metadata: metadata);

  if (shouldNotify) {
    VooToast.showError(
      message: message,
      title: category ?? 'Fatal Error',
      duration: const Duration(seconds: 10), // Longer duration for fatal errors
    );
  }
}