Modal<T extends InputBase> class

Inheritance

Constructors

Modal.builder(String panelText, String actionText, {PanelBorder borderType = PanelBorder.single, int padding = 1, Color? panelTextColor, Color? actionTextColor, Color? backgroundColor, Color? borderColor})
General builder factory for Modals. You need to set the handler functions appropriately based on what you want to use the modal for.
factory
Modal.ok(String panelText, {bool showCancel = false, PanelBorder borderType = PanelBorder.single, int? padding, Color? panelTextColor, Color? actionTextColor, Color? backgroundColor, Color? borderColor, Object? okResult, Object? cancelResult})
Creates a simple modal with "OK" (enter key) and optionally "Cancel" (esc key) actions. The modal panel will be rendered in the center of the Terminal that is used to render the modal's Layer.
factory
Modal.yesNo(String panelText, {PanelBorder borderType = PanelBorder.single, int? padding, Color? panelTextColor, Color? actionTextColor, Color? backgroundColor, Color? borderColor, Object? yesResult, Object? noResult})
Creates a simple modal with "Yes" (y key) and "No" (n key) actions. The modal panel will be rendered in the center of the Terminal that is used to render the modal's Layer.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isBound bool
Returns true if the layer is currently bound to a UserInterface.
no setterinherited
isHandlingInput bool
Should return true if this layer wants to handle input when it is the active (top-most) layer. Returns false if any bound UserInterface should not pass any input to the layer.
no setteroverride
isTransparent bool
Should true if this layer is transparent, allowing the layer below it to render. Returns false if this layer is opaque.
no setteroverride
onCancel ↔ void Function()
The handler to call for Cancel (esc key) actions
getter/setter pair
onNo ↔ void Function()
The handler to call for No (n key) actions
getter/setter pair
onOk ↔ void Function()
The handler to call for OK (enter key) actions
getter/setter pair
onYes ↔ void Function()
The handler to call for Yes (y key) actions
getter/setter pair
panel Panel
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
ui UserInterface<T>
The UserInterface that this Layer is bound to. Throws an exception if the layer is not currently bound.
no setterinherited

Methods

dirty() → void
Inform the bound UserInterface that this Layer needs to be rendered during the next UserInterface.render call.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onActive(Layer<T> popped, Object? result) → void
Called by the UI when the Layer above this one has been popped, making this layer the top-most in the bound UserInterface. If a result value was passed to UserInterface.pop, it is provided here as result.
inherited
onInput(T input) bool
If one is bound, the UserInterface will pass all bound input events to this Layer if it is the active (top-most) layer. If this method returns false (the default ), the respective lower-level input handler will be called.
inherited
onKeyDown(String key, String code, {required bool shift, required bool altOpt, required bool ctrl, required bool meta}) bool
If this Layer is active (top-most) and accepting inputs, any keyboard key down events not handled by the higher-level Layer.onInput handler will be passed here by the bound UserInterface.
override
onKeyUp(String key, String code, {required bool shift, required bool altOpt, required bool ctrl, required bool meta}) bool
If this Layer is active (top-most) and accepting inputs, all keyboard key up events will be passed here by the bound UserInterface.
inherited
onResize(Vec2 size) → void
Called whenever this Layer is bound to a new UserInterface or the Terminal assigned to the bound UI changes.
inherited
render(Terminal terminal) → void
Render the Layer using the given Terminal.
override
start() → void
Initialize the state if this Layer. This will be called only once, right after the layer is bound to a UserInterface.
inherited
toString() String
A string representation of this object.
inherited
update(double ds) → void
Update the state of this Layer. The provided value, ds, is the elapsed time in (fractional) seconds since the last call to update.
inherited

Operators

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