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

import 'dart:convert';
import 'package:domain/entity/notice_board_event_detail_entity.dart';
import 'package:widgets/load_state_layout.dart';
class EventDetailState {
  //页面 LoadView 状态的展示
  LoadState loadingState;
  String? errorMessage;
  NoticeBoardEventDetailEntity? detailInfo;

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

  EventDetailState copyWith({
    LoadState? loadingState,
    String? errorMessage,
    NoticeBoardEventDetailEntity? detailInfo,
  }) {
    return EventDetailState(
      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 EventDetailState.fromMap(Map<String, dynamic> map) {
    return EventDetailState(
      loadingState: map['loadingState'] as LoadState,
      errorMessage: map['errorMessage'] as String,
      detailInfo: map['detailInfo'] as NoticeBoardEventDetailEntity,
    );
  }
}