home_service_state.dart 1.4 KB

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