ToastrConfig constructor
const
ToastrConfig({
- required ToastrType type,
- required String message,
- String? title,
- Duration duration = const Duration(seconds: 5),
- Duration? extendedTimeout,
- bool dismissible = true,
- bool showCloseButton = false,
- Widget? customIcon,
- Color? backgroundColor,
- Color? textColor,
- Duration showDuration = const Duration(milliseconds: 300),
- Duration hideDuration = const Duration(milliseconds: 1000),
- ToastrPosition position = ToastrPosition.topRight,
- ToastrShowMethod showMethod = ToastrShowMethod.fadeIn,
- ToastrHideMethod hideMethod = ToastrHideMethod.fadeOut,
- Curve showEasing = Curves.easeOut,
- Curve hideEasing = Curves.easeIn,
- bool showProgressBar = false,
- bool preventDuplicates = false,
- 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,
});