import 'package:flutter/cupertino.dart'; import 'package:get/get.dart'; Future push(String routeName, {dynamic arguments}) async { return Get.toNamed(routeName, arguments: arguments); } Future pushAndPop(String routeName, {dynamic arguments}) async { return Get.offNamed(routeName, arguments: arguments); } Future popAndPush(String routeName, {dynamic arguments}) async { return Get.offAndToNamed(routeName, arguments: arguments); } Future pushAndPopAll(String routeName, {dynamic arguments}) async { return Get.offAllNamed(routeName, arguments: arguments); } void popBack({dynamic result, bool closeOverlays = false}) { Get.back(closeOverlays: closeOverlays, result: result); } bool canBack(BuildContext context) { return Navigator.of(context).canPop(); } BuildContext? get currentContext => Get.context; BuildContext? get currentOverlayContext => Get.overlayContext; T? getBinding({String? tag}) { if (Get.isRegistered(tag: tag)) { return Get.find(tag: tag); } else { return null; } }