community_state.dart 1.1 KB

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