Toast constructor

Toast({
  1. String? id,
  2. required String message,
  3. required ToastType type,
  4. VoidCallback? onDismiss,
  5. Duration? duration = const Duration(seconds: 5),
  6. 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;