import 'package:widgets/load_state_layout.dart'; class FollowingState { //页面 LoadView 状态的展示 LoadState loadingState; String? errorMessage; List>? list = []; FollowingState({ this.loadingState = LoadState.State_Loading, String? errorMessage, this.list, }); FollowingState copyWith({ LoadState? loadingState, String? errorMessage, int? page, int? limit, int? count, List>? list, }) { return FollowingState( loadingState: loadingState ?? this.loadingState, errorMessage: errorMessage ?? this.errorMessage, list: list ?? this.list, ); } Map toMap() { return { 'loadingState': this.loadingState, 'errorMessage': this.errorMessage, 'list': this.list, }; } factory FollowingState.fromMap(Map map) { return FollowingState( loadingState: map['loadingState'] as LoadState, errorMessage: map['errorMessage'] as String, list: map['list'] as List>, ); } }