facility_booking_state.dart 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import 'package:domain/entity/facility_book_entity.dart';
  2. import 'package:widgets/load_state_layout.dart';
  3. class FacilityBookingState {
  4. //当前选中的时间日期
  5. DateTime selectedDate;
  6. //页面 LoadView 状态的展示
  7. LoadState loadingState;
  8. String? errorMessage;
  9. //网络请求数据
  10. FacilityBookEntity? data;
  11. String? facilityId;
  12. String? facilityName;
  13. int index;
  14. int innerIndex;
  15. // =================================== Begin ↓ ===================================
  16. FacilityBookingState({
  17. required this.selectedDate,
  18. this.loadingState = LoadState.State_Loading,
  19. this.data,
  20. this.errorMessage,
  21. this.facilityId,
  22. this.facilityName,
  23. this.index = 0,
  24. this.innerIndex = 0,
  25. });
  26. FacilityBookingState copyWith({
  27. DateTime? selectedDate,
  28. LoadState? loadingState,
  29. String? errorMessage,
  30. String? facilityId,
  31. String? facilityName,
  32. FacilityBookEntity? data,
  33. int? index,
  34. int? innerIndex,
  35. }) {
  36. return FacilityBookingState(
  37. selectedDate: selectedDate ?? this.selectedDate,
  38. loadingState: loadingState ?? this.loadingState,
  39. errorMessage: errorMessage ?? this.errorMessage,
  40. data: data,
  41. facilityId: facilityId ?? this.facilityId,
  42. facilityName: facilityName ?? this.facilityName,
  43. index: index ?? this.index,
  44. innerIndex: innerIndex ?? this.innerIndex,
  45. );
  46. }
  47. }