0 purchases
weird listener
weird_listener #
Simplest state management! #
Flutter State Management library with zero boilerplate that has easiest setup and usage. #
Usage #
Create State #
final counter = ListenWeirdly(0);
// or
final counter = 0.listenWeirdly;
copied to clipboard
Thats all!
Use State #
WeirdListener(() => Text('$counter'))
copied to clipboard
Again, Thats all!
We can do '$counter' because of the override of toString method, if you want, you can also obtain it by calling 'counter.value';
Update State #
counter.value++;
// Or
counter.value = 1;
// Or
counter.update((value) => value + 1); // Increases value by 1
// For lists, maps and etc.
intList.update((value) {
value.add(5);
return value;
});
// Or
intList.value.add(5);
intList.notifyListeners();
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.