ToastrAction class

Action button configuration for toasts.

Toastr.success('Deleted',
  action: ToastrAction(label: 'Undo', onPressed: () => restore()),
);

Constructors

ToastrAction({required String label, required VoidCallback onPressed, Color? textColor, Color? backgroundColor, bool dismissOnPressed = true})
Creates a toast action button.
const

Properties

backgroundColor Color?
Custom background color for the button
final
dismissOnPressed bool
Whether tapping the action also dismisses the toast
final
hashCode int
The hash code for this object.
no setterinherited
label String
Button label text
final
onPressed VoidCallback
Callback when button is pressed
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textColor Color?
Custom text color for the button
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited