control

Creator: coderz1093

Last updated:

0 purchases

control Image
control Images

Languages

Categories

Add to Cart

Description:

control

Control: State Management for Flutter #







Installation #
Add the following dependency to your pubspec.yaml file:
dependencies:
control: <version>
copied to clipboard
Example #
/// Counter state for [CounterController]
typedef CounterState = ({int count, bool idle});

/// Counter controller
final class CounterController extends StateController<CounterState>
with SequentialControllerHandler {
CounterController({CounterState? initialState})
: super(initialState: initialState ?? (idle: true, count: 0));

void add(int value) => handle(() async {
setState((idle: false, count: state.count));
await Future<void>.delayed(const Duration(milliseconds: 1500));
setState((idle: true, count: state.count + value));
});

void subtract(int value) => handle(() async {
setState((idle: false, count: state.count));
await Future<void>.delayed(const Duration(milliseconds: 1500));
setState((idle: true, count: state.count - value));
});
}
copied to clipboard
Coverage #

Changelog #
Refer to the Changelog to get all release notes.
Maintainers #

Matiunin Mikhail aka Plague Fox

Funding #
If you want to support the development of our library, there are several ways you can do it:

Buy me a coffee
Support on Patreon
Subscribe through Boosty

We appreciate any form of support, whether it's a financial donation or just a star on GitHub. It helps us to continue developing and improving our library. Thank you for your support!
License #
MIT

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.