advanced_change_notifier 1.0.0 advanced_change_notifier: ^1.0.0 copied to clipboard
A ChangeNotfier alternative used to avoid redundant code .
example/advanced_change_notifier_example.dart
import 'package:advanced_change_notifier/advanced_change_notifier.dart';
class ChatService extends AdvancedChangeNotifier<String> {
sendMessage(String text) {
print("He said: '$text'");
notifyListeners(value: text);
}
}
void main() {
var service = ChatService();
service.addListener(
(value) async {
print("This listener was called and received '$value'");
},
);
service.sendMessage("A test of this package");
}