notification_state.dart 867 B

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