Skip to content

Commit 3c8dabe

Browse files
authored
Be more explicit when ValueNotifier notifies (#30461)
1 parent 952e307 commit 3c8dabe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/flutter/lib/src/foundation/change_notifier.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,18 @@ class _MergingListenable extends Listenable {
248248

249249
/// A [ChangeNotifier] that holds a single value.
250250
///
251-
/// When [value] is replaced, this class notifies its listeners.
251+
/// When [value] is replaced with something that is not equal to the old
252+
/// value as evaluated by the equality operator ==, this class notifies its
253+
/// listeners.
252254
class ValueNotifier<T> extends ChangeNotifier implements ValueListenable<T> {
253255
/// Creates a [ChangeNotifier] that wraps this value.
254256
ValueNotifier(this._value);
255257

256258
/// The current value stored in this notifier.
257259
///
258-
/// When the value is replaced, this class notifies its listeners.
260+
/// When the value is replaced with something that is not equal to the old
261+
/// value as evaluated by the equality operator ==, this class notifies its
262+
/// listeners.
259263
@override
260264
T get value => _value;
261265
T _value;

0 commit comments

Comments
 (0)