component_router_service.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'package:get/get.dart';
  2. import 'package:router/componentRouter/auth_service.dart';
  3. import 'package:router/componentRouter/job_sg_service.dart';
  4. import 'package:router/componentRouter/labour_service.dart';
  5. import 'package:router/componentRouter/labour_sg_service.dart';
  6. import 'job_service.dart';
  7. import 'report_service.dart';
  8. /**
  9. * 全局的组件路由服务,记得在 main.dart 中注入
  10. */
  11. class ComponentRouterServices{
  12. static final ComponentRouterServices _instance = ComponentRouterServices._internal();
  13. factory ComponentRouterServices() {
  14. return _instance;
  15. }
  16. ComponentRouterServices._internal();
  17. //获取 Labour 组件的服务
  18. static LabourService get labourService => Get.find();
  19. //获取 Job 组件的服务
  20. static JobService get jobService => Get.find();
  21. //获取 Report 组件的服务
  22. static ReportService get reportService => Get.find();
  23. //获取 Auth 组件服务
  24. static AuthService get authService => Get.find();
  25. //获取 Job 组件的服务 (新加坡)
  26. static JobSGService get jobSGService => Get.find();
  27. //获取 Labour 组件的服务 (新加坡)
  28. static LabourSGService get labourSGService => Get.find();
  29. }