community_state.dart 1001 B

12345678910111213141516171819202122232425262728293031323334353637
  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. int? curIdx;
  7. CommunityVmState({
  8. List<Map<String, dynamic>>? topSectionsData,
  9. this.curIdx = 0,
  10. }) : topSectionsData = topSectionsData?? [
  11. {
  12. "title": "News Feed",
  13. "icon": Assets.communityNesFeed,
  14. "pageStartInstanceFn": NewsfeedPage.startInstance,
  15. "page": const NewsfeedPage(),
  16. },
  17. {
  18. "title": "Garage Sale",
  19. "icon": Assets.communityGarageSale,
  20. "pageStartInstanceFn": GaragesalePage.startInstance,
  21. "page": const GaragesalePage(),
  22. },
  23. ];
  24. CommunityVmState copyWith({
  25. List<Map<String, dynamic>>? topSectionsData,
  26. int? curIdx = 0,
  27. }) {
  28. return CommunityVmState(
  29. topSectionsData: topSectionsData ?? this.topSectionsData,
  30. curIdx: curIdx ?? 0,
  31. );
  32. }
  33. }