ValueNotifier should have an addValueListener method. #148171
Labels
c: new feature
Nothing broken; request for a new capability
c: proposal
A detailed proposal for a change to Flutter
framework
flutter/packages/flutter repository. See also f: labels.
P3
Issues that are less important to the Flutter project
team-framework
Owned by Framework team
triaged-framework
Triaged by Framework team
Use case
A listener of a ValueNotifier often needs the value itself when it is called, but the addListener method does not return the value of the ValueNotifier. It is often easier to get the value within the listener, for example in this case:
Before adding the listener, a variable must be created that can then be called within the listener.
It would be easier to pass the variable to the listener as follows:
Proposal
The ValueNotifier should have an
addValueListener
-Method which passes the value to its listeners.The text was updated successfully, but these errors were encountered: