my_household_state.dart 828 B

123456789101112131415161718192021222324252627282930313233
  1. import 'package:domain/entity/user_me_entity.dart';
  2. import 'package:widgets/load_state_layout.dart';
  3. class MyHouseholdState{
  4. //页面 LoadView 状态的展示
  5. LoadState loadingState;
  6. String? errorMessage;
  7. List<UserMeHouseholds> datas; //页面列表数据
  8. // =================================== Begin ↓ ===================================
  9. MyHouseholdState({
  10. this.loadingState = LoadState.State_Loading,
  11. this.errorMessage,
  12. required this.datas,
  13. });
  14. MyHouseholdState copyWith({
  15. LoadState? loadingState,
  16. String? errorMessage,
  17. bool? needShowPlaceholder,
  18. List<UserMeHouseholds>? datas,
  19. }) {
  20. return MyHouseholdState(
  21. errorMessage: errorMessage ?? this.errorMessage,
  22. loadingState: loadingState ?? this.loadingState,
  23. datas: datas ?? this.datas,
  24. );
  25. }
  26. }