DestructiveConfirmModel class

A destructive confirmation component that requires typing to confirm.

Used for dangerous operations where accidental confirmation should be prevented.

Example

final confirm = DestructiveConfirmModel(
  prompt: 'This will delete all data. Type "DELETE" to confirm:',
  confirmText: 'DELETE',
);
Inheritance

Constructors

DestructiveConfirmModel({required String prompt, required String confirmText, bool caseSensitive = true, bool showHelp = true, ConfirmKeyMap? keyMap, ConfirmStyles? styles})
Creates a new destructive confirm model.

Properties

caseSensitive bool
Whether the confirmation is case-sensitive.
final
confirmText String
The text the user must type to confirm.
final
error String?
Gets the current error message.
no setter
hashCode int
The hash code for this object.
no setterinherited
isMatch bool
Gets whether the current input matches the confirm text.
no setter
keyMap ConfirmKeyMap
Key bindings.
final
prompt String
The prompt to display.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showHelp bool
Whether to show help text.
final
styles ConfirmStyles
Styles.
final
value String
Gets the current input value.
no setter

Methods

init() Cmd?
Returns an optional command to execute on program startup.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(Msg msg) → (DestructiveConfirmModel, Cmd?)
Updates the component state in response to a message.
override
view() String
Renders the current model state for display.
override

Operators

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