community_state.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import 'package:cs_resources/generated/assets.dart';
  2. import '../garagesale/garagesale_page.dart';
  3. import '../newsfeed/newsfeed_page.dart';
  4. class CommunityVmState {
  5. int? useTag = 0;
  6. List<Map<String, dynamic>>? topSectionsData;
  7. int? curIdx;
  8. dynamic? tabsRouter;
  9. dynamic? pageController;
  10. CommunityVmState({
  11. this.useTag = 0,
  12. List<Map<String, dynamic>>? topSectionsData,
  13. this.curIdx = 0,
  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. int? useTag,
  32. List<Map<String, dynamic>>? topSectionsData,
  33. int? curIdx = 0,
  34. dynamic? tabsRouter,
  35. dynamic? pageController,
  36. }) {
  37. return CommunityVmState(
  38. useTag: useTag ?? this.useTag,
  39. topSectionsData: topSectionsData ?? this.topSectionsData,
  40. curIdx: curIdx ?? 0,
  41. tabsRouter: tabsRouter ?? this.tabsRouter,
  42. pageController: pageController ?? this.pageController,
  43. );
  44. }
  45. }