InterruptMsg class

Message sent when an interrupt signal (SIGINT/Ctrl+C) is received.

This is distinct from QuitMsg in that it represents an external interrupt request rather than a programmatic quit command.

The model can handle this to:

  • Prompt for confirmation before quitting
  • Save state before exiting
  • Cancel a long-running operation
  • Ignore the interrupt entirely

Example

@override
(Model, Cmd?) update(Msg msg) {
  return switch (msg) {
    InterruptMsg() when hasUnsavedChanges => (
      copyWith(showConfirmDialog: true),
      null,
    ),
    InterruptMsg() => (this, Cmd.quit()),
    _ => (this, null),
  };
}
Inheritance

Constructors

InterruptMsg()
Creates an interrupt message.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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