property_page_state.dart 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import 'package:cs_resources/generated/assets.dart';
  2. import '../../ioan/property_ioan_page.dart';
  3. import '../../news/page/property_news_page.dart';
  4. import '../../rent/page/property_rent_page.dart';
  5. import '../../sale/page/property_sale_page.dart';
  6. class PropertyVmState {
  7. List<Map<String, dynamic>>? topSectionsData;
  8. int? currentPageViewIdx;
  9. PropertyVmState({
  10. List<Map<String, dynamic>>? topSectionsData,
  11. this.currentPageViewIdx = 0,
  12. }) : topSectionsData = topSectionsData?? [
  13. {
  14. "title": "Ioan",
  15. "icon": Assets.propertyIoan,
  16. "pageStartInstanceFn": PropertyIoanPage.startInstance,
  17. "page": const PropertyIoanPage(),
  18. },
  19. {
  20. "title": "News",
  21. "icon": Assets.propertyNews,
  22. "pageStartInstanceFn": PropertyNewsPage.startInstance,
  23. "page": const PropertyNewsPage(),
  24. },
  25. {
  26. "title": "Sale",
  27. "icon": Assets.propertySale,
  28. "pageStartInstanceFn": PropertySalePage.startInstance,
  29. "page": const PropertySalePage(),
  30. },
  31. {
  32. "title": "Rent",
  33. "icon": Assets.propertyRent,
  34. "pageStartInstanceFn": PropertyRentPage.startInstance,
  35. "page": const PropertyRentPage(),
  36. },
  37. ];
  38. PropertyVmState copyWith({
  39. List<Map<String, dynamic>>? topSectionsData,
  40. int? currentPageViewIdx = 0,
  41. }) {
  42. return PropertyVmState(
  43. topSectionsData: topSectionsData ?? this.topSectionsData,
  44. currentPageViewIdx: currentPageViewIdx ?? 0,
  45. );
  46. }
  47. }