handleError method

void handleError(
  1. dynamic error
)

Implementation

void handleError(dynamic error) {
  // Handle errors based on user-defined logic
  if (onError != null) {
    onError!(error);
  } else {
    // Default error handling
    print('Error: $error');
  }
}