repair_state.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import 'package:cs_resources/generated/assets.dart';
  2. import 'package:cs_resources/generated/l10n.dart';
  3. class RepairVmState {
  4. List<Map<String, dynamic>>? topSectionsData;
  5. int currentPageViewIdx = 0;
  6. dynamic? tabsRouter;
  7. RepairVmState({
  8. List<Map<String, dynamic>>? topSectionsData,
  9. required this.currentPageViewIdx,
  10. this.tabsRouter,
  11. }) : topSectionsData = topSectionsData?? [
  12. {
  13. "title": S.current.service,
  14. "code": "service",
  15. "icon": Assets.serviceServiceType,
  16. },
  17. {
  18. "title": S.current.in_progress,
  19. "code": "inProgress",
  20. "icon": Assets.serviceInProgress,
  21. },
  22. {
  23. "title": S.current.history,
  24. "code": "history",
  25. "icon": Assets.serviceHistory,
  26. },
  27. ];
  28. RepairVmState copyWith({
  29. List<Map<String, dynamic>>? topSectionsData,
  30. int? currentPageViewIdx,
  31. dynamic? tabsRouter,
  32. }) {
  33. return RepairVmState(
  34. topSectionsData: topSectionsData ?? this.topSectionsData,
  35. currentPageViewIdx: currentPageViewIdx ?? this.currentPageViewIdx,
  36. tabsRouter: tabsRouter ?? this.tabsRouter,
  37. );
  38. }
  39. }