error static method

void error(
  1. BuildContext context,
  2. String message, {
  3. String? title,
  4. Duration? duration,
  5. ToastrPosition? position,
  6. ToastrShowMethod? showMethod,
  7. ToastrHideMethod? hideMethod,
  8. Duration? showDuration,
  9. Duration? hideDuration,
  10. bool? showProgressBar,
  11. bool? showCloseButton,
  12. bool? preventDuplicates,
})

Show an error toastr with the given message

Implementation

static void error(
  BuildContext context,
  String message, {
  String? title,
  Duration? duration,
  ToastrPosition? position,
  ToastrShowMethod? showMethod,
  ToastrHideMethod? hideMethod,
  Duration? showDuration,
  Duration? hideDuration,
  bool? showProgressBar,
  bool? showCloseButton,
  bool? preventDuplicates,
}) {
  _service.show(
    defaultConfig.copyWith(
      type: ToastrType.error,
      message: message,
      title: title,
      duration: duration, // Remove the invalid default of 0 seconds
      position: position,
      showMethod: showMethod,
      hideMethod: hideMethod,
      showDuration: showDuration,
      hideDuration: hideDuration,
      showProgressBar: showProgressBar,
      showCloseButton:
          showCloseButton ?? true, // Show close button for errors
      preventDuplicates: preventDuplicates,
    ),
    context,
  );
}