toggleable 0.0.2
toggleable: ^0.0.2 copied to clipboard
Helps maintaining the state which can toggle. It provides various of helper methods.
Features #
Getting started #
Usage #
final mySwitch = ToggleableState();
mySwitch.on();
mySwitch.isOn; // true
mySwitch.isEnabled; // true
mySwitch.off();
mySwitch.isOff; // true
mySwitch.isDisabled; // true
mySwitch.toggle();
int someOtherState = 1;
mySwitch.addListener(turnOnCallback: () => someOtherState++);
Additional information #
- Please improve this package by contributing!