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