refresh method
Triggers notifyListeners after a zero-duration delay. Returns a
Future that completes once the notify has been scheduled and
(potentially) fired — callers that need to read post-notify state
can await it.
Safe to call right before dispose; the scheduled tick is a no-op once isDisposed flips true.
Implementation
Future<void> refresh() {
return Future.delayed(Duration.zero, () {
if (!isDisposed) notifyListeners();
});
}