The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
Removed scheduleMicrotask wrapping of notifyListeners since the hack seems to be unneeded now.
Renamed _safeNotifyListeners to _notifyListeners.
Although _notifyListeners could be replaced with a direct call to notifyListeners, we should leave it wrapped since the follow on PR to enable Router.neglect will require it anyway.
:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)
Removes unneeded wrapping of notifyListeners in scheduleMicrotask
:arrow_heading_down: What is the current behavior?
Wrapping notifyListeners currently moves its execution out of scope and prevents wrapping with Router.neglect or Router.navigate.
:new: What is the new behavior (if this is a feature change)?
Removing scheduleMicrotask keeps execution within the current task.
:boom: Does this PR introduce a breaking change?
No
:bug: Recommendations for testing
All tests pass, and all examples run, there isn't any direct test of the original hack so observation is it.
:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)
Removes unneeded wrapping of notifyListeners in scheduleMicrotask
:arrow_heading_down: What is the current behavior?
Wrapping notifyListeners currently moves its execution out of scope and prevents wrapping with Router.neglect or Router.navigate.
:new: What is the new behavior (if this is a feature change)?
Removing scheduleMicrotask keeps execution within the current task.
:boom: Does this PR introduce a breaking change?
No
:bug: Recommendations for testing
All tests pass, and all examples run, there isn't any direct test of the original hack so observation is it.
:memo: Links to relevant issues/docs
https://github.com/csells/go_router/issues/226
:thinking: Checklist before submitting
master
.