community_state.dart 1.4 KB

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