services_state.dart 1.2 KB

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