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