Toast constructor
Toast({
- String? id,
- required String message,
- required ToastType type,
- VoidCallback? onDismiss,
- Duration? duration = const Duration(seconds: 5),
- ToastAction? action,
Implementation
Toast({
String? id,
required this.message,
required this.type,
this.onDismiss,
Duration? duration = const Duration(seconds: 5),
this.action,
}) : id = id ?? _generateId(),
created = clock.now(),
expireAt = duration != null ? clock.now().add(duration) : null;