services_state.dart 1.3 KB

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