Be aware of your routes with RouteAware — Flutter!

There can be cases when you wish to perform certain actions on the change navigation history. This is where RouteAware comes to the rescue!

final RouteObserver<ModalRoute> routeObserver = RouteObserver<ModalRoute>();
void initState() {
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
routeObserver.subscribe(this, ModalRoute.of(context)!);

Don’t forget to connect with me!

Don’t stop, until you are breathing!💙
- Abhishek Doshi

Google Developer Expert — Dart & Flutter 💙