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