MToggleAction class

Flips a boolean in shared storage, then redraws the widget.

Runs entirely on-device — no app launch and no network — so it suits in-widget state like a °C/°F switch. Pair it with MVisibility(bind: key, ...) to show a different subtree per state, and read or seed the same key from the app via MosaicBridge.saveBool. Requires iOS 17+ for the in-widget button (older iOS opens the app).

Inheritance

Constructors

MToggleAction(String key)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
key String
The shared-storage key holding the boolean.
final
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
toJson() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

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