DialogConfirmText constructor
const
DialogConfirmText({
- Key? key,
- bool destructive = false,
- required String title,
- String? description,
- Widget descriptionWidget = const SizedBox.shrink(),
- String confirmText = "Confirm",
- String cancelText = "Cancel",
- required String verificationText,
- required void onConfirm(),
- bool ignoreCase = false,
- List<
Widget> ? actions, - TextInputType? keyboardType,
The primary constructor for initializing the confirmation dialog.
Configures the dialog's appearance and behavior, including the text the user must enter for confirmation. All parameters allow customization of the UI and validation logic. The dialog is built as a stateful widget to handle input focus, animations, and validation dynamically. Defaults provide sensible values for common use cases, but required fields ensure essential functionality.
References: Uses TextField for input, OutlineButton for cancel, and PrimaryButton or DestructiveButton for confirm based on the destructive flag.
Implementation
const DialogConfirmText({
super.key,
this.destructive = false,
required this.title,
this.description,
this.descriptionWidget = const SizedBox.shrink(),
this.confirmText = "Confirm",
this.cancelText = "Cancel",
required this.verificationText,
required this.onConfirm,
this.ignoreCase = false,
this.actions,
this.keyboardType,
});