I want to add a listener to a ChangeNotifier. And trigger this listener only once. For example:
final changeNotifier = ChangeNotifier();
changeNotifier.addListener(() {
debugPrint("Run callback");
});
changeNotifier.notifyListeners();
changeNotifier.notifyListeners();
changeNotifier.notifyListeners();
This code will print 3 times "Run callback". I want to print "Run callback" only once. How to do that.