123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import 'package:widgets/load_state_layout.dart';
- class FollowingState {
- //页面 LoadView 状态的展示
- LoadState loadingState;
- String? errorMessage;
- int? curPage;
- int? pageSize = 10;
- int? filterCount = 0;
- List<Map<String, dynamic>>? list = [];
- FollowingState({
- this.loadingState = LoadState.State_Loading,
- String? errorMessage,
- this.curPage = 1,
- this.pageSize = 10,
- this.filterCount = 0,
- this.list,
- });
- FollowingState copyWith({
- LoadState? loadingState,
- String? errorMessage,
- int? curPage,
- int? pageSize,
- int? filterCount,
- List<Map<String, dynamic>>? list,
- }) {
- return FollowingState(
- loadingState: loadingState ?? this.loadingState,
- errorMessage: errorMessage ?? this.errorMessage,
- curPage: curPage ?? this.curPage,
- pageSize: pageSize ?? this.pageSize,
- filterCount: filterCount ?? this.filterCount,
- list: list ?? this.list,
- );
- }
- Map<String, dynamic> toMap() {
- return {
- 'loadingState': this.loadingState,
- 'errorMessage': this.errorMessage,
- 'curPage': this.curPage,
- 'pageSize': this.pageSize,
- 'filterCount': this.filterCount,
- 'list': this.list,
- };
- }
- factory FollowingState.fromMap(Map<String, dynamic> map) {
- return FollowingState(
- loadingState: map['loadingState'] as LoadState,
- errorMessage: map['errorMessage'] as String,
- curPage: map['curPage'] as int,
- pageSize: map['pageSize'] as int,
- filterCount: map['filterCount'] as int,
- list: map['list'] as List<Map<String, dynamic>>,
- );
- }
- }
|