property_page_state.dart 1.6 KB

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