1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import 'package:domain/entity/paid_service_entity.dart';
- import 'package:widgets/load_state_layout.dart';
- import '../../../constants_services.dart';
- import 'home_service_vm.dart';
- class HomeServiceState {
- //页面 LoadView 状态的展示
- LoadState loadingState;
- String? errorMessage;
- String? keyword;
- bool? isLiked;
- String sort = defaultSortType.name;
- // contact type 类型选项
- final List<String> sortByOptionsList = servicesConstants.sortByOptionsMap.keys.toList();
- String? sortBySelectedOption;
- List<PaidServiceList> activeCateGoryList;
- List<PaidServiceList> list;
- HomeServiceState({
- this.loadingState = LoadState.State_Loading,
- String? errorMessage,
- this.keyword,
- this.isLiked,
- required this.sort,
- this.sortBySelectedOption ,
- this.activeCateGoryList = const [],
- required this.list,
- });
- HomeServiceState copyWith({
- LoadState? loadingState,
- String? errorMessage,
- String? keyword,
- bool? isLiked,
- String? sort,
- String? sortBySelectedOption,
- List<PaidServiceList>? activeCateGoryList,
- List<PaidServiceList>? list,
- }) {
- return HomeServiceState(
- loadingState: loadingState ?? this.loadingState,
- errorMessage: errorMessage ?? this.errorMessage,
- keyword: keyword ?? this.keyword,
- isLiked: isLiked ?? this.isLiked,
- sort: sort ?? this.sort,
- sortBySelectedOption: sortBySelectedOption ?? this.sortBySelectedOption,
- activeCateGoryList: activeCateGoryList ?? this.activeCateGoryList,
- list: list ?? this.list,
- );
- }
- }
|