Be more explicit when ValueNotifier notifies (#30461)

This commit is contained in:
Michael Goderbauer 2019-04-04 00:13:07 -07:00 committed by GitHub
parent 952e307dcb
commit 3c8dabefe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,14 +248,18 @@ class _MergingListenable extends Listenable {
/// A [ChangeNotifier] that holds a single value.
///
/// When [value] is replaced, this class notifies its listeners.
/// When [value] is replaced with something that is not equal to the old
/// value as evaluated by the equality operator ==, this class notifies its
/// listeners.
class ValueNotifier<T> extends ChangeNotifier implements ValueListenable<T> {
/// Creates a [ChangeNotifier] that wraps this value.
ValueNotifier(this._value);
/// The current value stored in this notifier.
///
/// When the value is replaced, this class notifies its listeners.
/// When the value is replaced with something that is not equal to the old
/// value as evaluated by the equality operator ==, this class notifies its
/// listeners.
@override
T get value => _value;
T _value;