ThrottledNotifier class
帧对齐、带"无监听者不调度"的轻量通知器。 Frame-aligned, no-listener-no-schedule notifier.
与 ChangeNotifier 不同:同一帧内的多次 notifyThrottled 合并为一次 (下一帧绘制后触发),且当没有任何监听者(面板未挂载)时完全不调度,省电。 Unlike ChangeNotifier, repeated notifyThrottled in the same frame coalesce into one (fired after the next frame paint), and when there is no listener (panel not mounted) it schedules nothing — saving power.
- Inheritance
-
- Object
- ChangeNotifier
- ThrottledNotifier
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
notifyThrottled(
) → void - 帧对齐版 notifyListeners:合并同帧多次通知,无监听者时不调度。 Frame-aligned notifyListeners: coalesces same-frame notifications, no-op without listeners.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resetScheduled(
) → void - 重置帧排程标志(dispose 时调用)/ Reset the frame-scheduling flag (on dispose)
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited