dreampad/lib/app/shared/helpers/getx_route_observer.dart

15 lines
435 B
Dart
Raw Normal View History

2023-11-28 10:44:58 +08:00
import 'package:flutter/material.dart';
import 'package:get/get_navigation/src/router_report.dart';
class GetXRouteObserver extends NavigatorObserver {
@override
void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
RouterReportManager.reportCurrentRoute(route);
}
@override
void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) async {
RouterReportManager.reportRouteDispose(route);
}
}