rewards_state.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
  2. import 'dart:convert';
  3. import 'package:domain/entity/rewards_index_entity.dart';
  4. import 'package:widgets/load_state_layout.dart';
  5. class RewardsState {
  6. //页面 LoadView 状态的展示
  7. LoadState loadingState;
  8. String? errorMessage;
  9. RewardsIndexEntity? list;
  10. RewardsState({
  11. this.loadingState = LoadState.State_Loading,
  12. String? errorMessage,
  13. RewardsIndexEntity? list
  14. }) : list = list ?? RewardsIndexEntity();
  15. RewardsState copyWith({
  16. LoadState? loadingState,
  17. String? errorMessage,
  18. RewardsIndexEntity? list,
  19. }) {
  20. return RewardsState(
  21. loadingState: loadingState ?? this.loadingState,
  22. errorMessage: errorMessage ?? this.errorMessage,
  23. list: list ?? this.list,
  24. );
  25. }
  26. Map<String, dynamic> toMap() {
  27. return {
  28. 'list': this.list,
  29. };
  30. }
  31. factory RewardsState.fromMap(Map<String, dynamic> map) {
  32. return RewardsState(
  33. list: map['list'] as RewardsIndexEntity,
  34. );
  35. }
  36. }