/// YApi QuickType插件生成，具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation

import 'dart:convert';


import 'package:domain/entity/notice_board_announ_detail_entity.dart';
import 'package:widgets/load_state_layout.dart';

class AnnouncementDetailState {
  //页面 LoadView 状态的展示
  LoadState loadingState;
  String? errorMessage;
  NoticeBoardAnnounDetailEntity? detailInfo;

  AnnouncementDetailState({
    this.loadingState = LoadState.State_Loading,
    String? errorMessage,
    NoticeBoardAnnounDetailEntity? detailInfo,
  }) : detailInfo = detailInfo ?? NoticeBoardAnnounDetailEntity();

  AnnouncementDetailState copyWith({
    LoadState? loadingState,
    String? errorMessage,
    NoticeBoardAnnounDetailEntity? detailInfo,
  }) {
    return AnnouncementDetailState(
      loadingState: loadingState ?? this.loadingState,
      errorMessage: errorMessage ?? this.errorMessage,
      detailInfo: detailInfo ?? this.detailInfo,
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'loadingState': this.loadingState,
      'errorMessage': this.errorMessage,
      'detailInfo': this.detailInfo,
    };
  }

  factory AnnouncementDetailState.fromMap(Map<String, dynamic> map) {
    return AnnouncementDetailState(
      loadingState: map['loadingState'] as LoadState,
      errorMessage: map['errorMessage'] as String,
      detailInfo: map['detailInfo'] as NoticeBoardAnnounDetailEntity,
    );
  }
}