Skip to content

Instantly share code, notes, and snippets.

@shivanchalaeologic
Created August 11, 2020 09:45
Show Gist options
  • Save shivanchalaeologic/cf732cc93dd98046c431e928c0bf135b to your computer and use it in GitHub Desktop.
Save shivanchalaeologic/cf732cc93dd98046c431e928c0bf135b to your computer and use it in GitHub Desktop.
/// An interface for objects that are aware of their current [Route].
///
/// This is used with [RouteObserver] to make a widget aware of changes to the
/// [Navigator]'s session history.
abstract class RouteAware {
/// Called when the top route has been popped off, and the current route
/// shows up.
void didPopNext() { }
/// Called when the current route has been pushed.
void didPush() { }
/// Called when the current route has been popped off.
void didPop() { }
/// Called when a new route has been pushed, and the current route is no
/// longer visible.
void didPushNext() { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment