ToastrConfig constructor

const ToastrConfig({
  1. required ToastrType type,
  2. required String message,
  3. String? title,
  4. Duration duration = const Duration(seconds: 5),
  5. Duration? extendedTimeout,
  6. bool dismissible = true,
  7. bool showCloseButton = false,
  8. Widget? customIcon,
  9. Color? backgroundColor,
  10. Color? textColor,
  11. Duration showDuration = const Duration(milliseconds: 300),
  12. Duration hideDuration = const Duration(milliseconds: 1000),
  13. ToastrPosition position = ToastrPosition.topRight,
  14. ToastrShowMethod showMethod = ToastrShowMethod.fadeIn,
  15. ToastrHideMethod hideMethod = ToastrHideMethod.fadeOut,
  16. Curve showEasing = Curves.easeOut,
  17. Curve hideEasing = Curves.easeIn,
  18. bool showProgressBar = false,
  19. bool preventDuplicates = false,
  20. String? duplicateKey,
})

Creates a new ToastrConfig with the specified parameters.

The type and message parameters are required. All other parameters have sensible defaults.

Implementation

const ToastrConfig({
  required this.type,
  required this.message,
  this.title,
  this.duration = const Duration(seconds: 5),
  this.extendedTimeout,
  this.dismissible = true,
  this.showCloseButton = false,
  this.customIcon,
  this.backgroundColor,
  this.textColor,
  this.showDuration = const Duration(milliseconds: 300),
  this.hideDuration = const Duration(milliseconds: 1000),
  this.position = ToastrPosition.topRight,
  this.showMethod = ToastrShowMethod.fadeIn,
  this.hideMethod = ToastrHideMethod.fadeOut,
  this.showEasing = Curves.easeOut,
  this.hideEasing = Curves.easeIn,
  this.showProgressBar = false,
  this.preventDuplicates = false,
  this.duplicateKey,
});