12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
- import 'dart:convert';
- import 'package:domain/entity/rewards_index_entity.dart';
- import 'package:widgets/load_state_layout.dart';
- class RewardsState {
- //页面 LoadView 状态的展示
- LoadState loadingState;
- String? errorMessage;
- RewardsIndexEntity? list;
- RewardsState({
- this.loadingState = LoadState.State_Loading,
- String? errorMessage,
- RewardsIndexEntity? list
- }) : list = list ?? RewardsIndexEntity();
- RewardsState copyWith({
- LoadState? loadingState,
- String? errorMessage,
- RewardsIndexEntity? list,
- }) {
- return RewardsState(
- loadingState: loadingState ?? this.loadingState,
- errorMessage: errorMessage ?? this.errorMessage,
- list: list ?? this.list,
- );
- }
- Map<String, dynamic> toMap() {
- return {
- 'list': this.list,
- };
- }
- factory RewardsState.fromMap(Map<String, dynamic> map) {
- return RewardsState(
- list: map['list'] as RewardsIndexEntity,
- );
- }
- }
|