community_state.dart 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'package:cpt_community/modules/community/community_page.dart';
  2. import 'package:cs_resources/generated/assets.dart';
  3. import '../garage/garage_page.dart';
  4. class CommunityVmState {
  5. List<Map<String, dynamic>>? topSectionsData;
  6. List? tabsList = ["News", "Following", "For You"];
  7. dynamic? tabsRouter;
  8. dynamic? pageController;
  9. CommunityVmState({
  10. List<Map<String, dynamic>>? topSectionsData,
  11. this.tabsList,
  12. this.tabsRouter,
  13. this.pageController,
  14. }) : topSectionsData = topSectionsData?? [
  15. {
  16. "title": "News Feed",
  17. "icon": Assets.communityNesFeed,
  18. "pageStartInstanceFn": CommunityPage.startInstance,
  19. "page": const CommunityPage(),
  20. },
  21. {
  22. "title": "Garage Sale",
  23. "icon": Assets.communityGarageSale,
  24. "pageStartInstanceFn": GaragePage.startInstance,
  25. "page": const GaragePage(),
  26. },
  27. ];
  28. CommunityVmState copyWith({
  29. List<Map<String, dynamic>>? topSectionsData,
  30. List? tabsList,
  31. dynamic? tabsRouter,
  32. dynamic? pageController,
  33. }) {
  34. return CommunityVmState(
  35. topSectionsData: topSectionsData ?? this.topSectionsData,
  36. tabsList: tabsList ?? this.tabsList,
  37. tabsRouter: tabsRouter ?? this.tabsRouter,
  38. pageController: pageController ?? this.pageController,
  39. );
  40. }
  41. }