home_service_state.dart 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'package:domain/entity/paid_service_entity.dart';
  2. import 'package:widgets/load_state_layout.dart';
  3. class HomeServiceState {
  4. //页面 LoadView 状态的展示
  5. LoadState loadingState;
  6. String? errorMessage;
  7. String? keyword;
  8. bool? isLiked;
  9. // contact type 类型选项
  10. final List<String> sortByOptionsList = ["Most Likes", "Most bookmarked", "View at Most"];
  11. String? sortBySelectedOption;
  12. List<PaidServiceList> activeCateGoryList;
  13. List<PaidServiceList> list;
  14. HomeServiceState({
  15. this.loadingState = LoadState.State_Loading,
  16. String? errorMessage,
  17. this.keyword,
  18. this.isLiked,
  19. this.sortBySelectedOption ,
  20. this.activeCateGoryList = const [],
  21. required this.list,
  22. });
  23. HomeServiceState copyWith({
  24. LoadState? loadingState,
  25. String? errorMessage,
  26. String? keyword,
  27. bool? isLiked,
  28. String? sortBySelectedOption,
  29. List<PaidServiceList>? activeCateGoryList,
  30. List<PaidServiceList>? list,
  31. }) {
  32. return HomeServiceState(
  33. loadingState: loadingState ?? this.loadingState,
  34. errorMessage: errorMessage ?? this.errorMessage,
  35. keyword: keyword ?? this.keyword,
  36. isLiked: isLiked ?? this.isLiked,
  37. sortBySelectedOption: sortBySelectedOption ?? this.sortBySelectedOption,
  38. activeCateGoryList: activeCateGoryList ?? this.activeCateGoryList,
  39. list: list ?? this.list,
  40. );
  41. }
  42. }