advanced_change_notifier 1.0.1 copy "advanced_change_notifier: ^1.0.1" to clipboard
advanced_change_notifier: ^1.0.1 copied to clipboard

A ChangeNotfier alternative used to avoid redundant code .

Main purpose #

This package helps you ensuring your services and widgets are always notified and provided with the proper values whenever a change happens in order to avoid unneccessary requests and method calls after an event.

Features #

In order to avoid unnecessary method calls just to retrieve the new values, this package resembles the known "ChangeNotifier" with the difference of the new values being passed to the listeners by the notifier.

Usage #

You can either use the abse class to extend from it or use it as an mixin. The base class takes an generic type argument and makes sure you are always provided with the changes on any event.

class ChatService extends AdvancedChangeNotifier<String> {
  sendMessage(String text) {
    print("He said: '$text'");
    notifyListeners(value: text);
  }
}

Additional information #

This package is exceptionally usefule when using it on widgets or their services and can help reducing redundant or unneccessary code by avoiding to request data again everytime an event happens but passing it over with the listener itsself instead.

0
likes
140
pub points
50%
popularity

Publisher

unverified uploader

A ChangeNotfier alternative used to avoid redundant code .

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on advanced_change_notifier