import 'package:flutter/cupertino.dart'; import 'package:get/get_navigation/src/router_report.dart'; /// 手动让getx感知原生路由 (固定代码无需修改) class GetXRouterObserver extends NavigatorObserver { @override void didPush(Route route, Route? previousRoute) { RouterReportManager.reportCurrentRoute(route); } @override void didPop(Route route, Route? previousRoute) async { RouterReportManager.reportRouteDispose(route); } }