12345678910111213141516 |
- import 'package:flutter/cupertino.dart';
- import 'package:get/get_navigation/src/router_report.dart';
- /// 手动让getx感知原生路由 (固定代码无需修改)
- class GetXRouterObserver 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);
- }
- }
|