load_switch 1.2.0 copy "load_switch: ^1.2.0" to clipboard
load_switch: ^1.2.0 copied to clipboard

A highly customizable toggle switch with a loading state. Useful when getting data from remote calls.

Version Version

Minimal code #

bool value = false;

Future<bool> _getFuture() async {
    await Future.delayed(const Duration(seconds: 2));
    return !value;
}

LoadSwitch(
    value: value,
    future: _getFuture,
    onChange: (v) {
        value = v;
        print('Value changed to $v');
        setState(() {});
    },
    onTap: (v) {
        print('Tapping while value is $v');
    },
)

Issues / Features #

Found a bug or want a new feature? Open an issue in the Github repository of the project.

38
likes
140
pub points
89%
popularity

Publisher

verified publisheresentis.dev

A highly customizable toggle switch with a loading state. Useful when getting data from remote calls.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on load_switch