DeleteIconButton constructor
Creates a DeleteIconButton with customizable delete icon, confirmation text, and callback.
Use named parameters for flexibility: key for standard widget identification; deleteIcon initializes the button's icon (defaults to Icons.trash for standard delete visual); menuText sets the confirmation dialog's button text (defaults to "Delete"); thing (required) provides the item name interpolated into the dialog title for context (e.g., "Delete User?"); description (optional) adds explanatory text to the dialog; deleteConfirm reserves text for potential future confirmation overrides (defaults to "Delete", currently unused); onDelete (required) defines the callback executed upon user confirmation, ideally handling the actual deletion and optional Toast feedback. Supports const construction for performance in lists like Tile or DataTable.
Implementation
const DeleteIconButton({
super.key,
this.deleteIcon = Icons.trash,
this.menuText = "Delete",
required this.thing,
this.description,
this.deleteConfirm = "Delete",
required this.onDelete,
});