component_router_service.dart 879 B

12345678910111213141516171819202122232425262728293031323334
  1. import 'package:get/get.dart';
  2. import 'package:router/componentRouter/auth_service.dart';
  3. import 'package:router/componentRouter/uk_service.dart';
  4. import 'package:router/componentRouter/vn_service.dart';
  5. import 'sg_service.dart';
  6. /*
  7. * 全局的组件路由服务,记得在 main.dart 中注入
  8. */
  9. class ComponentRouterServices{
  10. static final ComponentRouterServices _instance = ComponentRouterServices._internal();
  11. factory ComponentRouterServices() {
  12. return _instance;
  13. }
  14. ComponentRouterServices._internal();
  15. //获取 Auth 组件服务
  16. static AuthService get authService => Get.find();
  17. //获取 SG 组件服务(新加坡)
  18. static SGService get sgService => Get.find();
  19. //获取 UK 组件服务(英国)
  20. static UKService get ukService => Get.find();
  21. //获取 VN 组件服务(越南)
  22. static VNService get vnService => Get.find();
  23. }