ConnectionException constructor

const ConnectionException({
  1. void onRetry()?,
  2. String? host,
  3. String? errorText,
  4. bool ifOpenDialog = true,
})

Creates a ConnectionException.

If you pass it an onRetry callback, it will call it when the user presses the "Ok" button in the dialog. Otherwise, it will just close the dialog.

If you pass it a host, it will say "It was not possible to connect to $host". Otherwise, it will simply say "There is no Internet connection".

Implementation

const ConnectionException({
  void Function()? onRetry,
  this.host,
  String? errorText,
  bool ifOpenDialog = true,
}) : super(
  (host != null) ? 'There is no Internet' : 'It was not possible to connect to $host.',
  reason: 'Please, verify your connection.',
  code: null,
  onOk: onRetry,
  onCancel: null,
  hardCause: null,
  errorText: errorText ?? 'No Internet connection',
  ifOpenDialog: ifOpenDialog,
);