SafeChangeNotifier class

A safe implementation of ChangeNotifier that prevents errors after disposal.

ChangeNotifier 的安全实现,防止在释放后发生错误

Inheritance
Mixed-in types

Constructors

SafeChangeNotifier.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Check if the notifier has listeners and log a warning if it does.
no setterinherited
isDisposed bool
Whether the notifier has been disposed.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Safely add a listener if the notifier is not disposed.
inherited
dispose() → void
Mark the notifier as disposed and release resources.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Safely notify listeners if the notifier is not disposed.
inherited
removeListener(VoidCallback listener) → void
Safely remove a listener if the notifier is not disposed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited