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

class FormDetailState{

  //页面 LoadView 状态的展示
  LoadState loadingState;
  String? errorMessage;

  int status;  // 0是Pending , 1是Approve , 2是Not Approve

  FormDetailEntity? forDetail;

  String? typeId;
  String? estateFormId;

  // ===================================  Begin  ↓  ===================================

  FormDetailState({
    this.loadingState = LoadState.State_Loading,
    this.errorMessage,
    this.status = 0,
    this.forDetail,
    this.typeId,
    this.estateFormId,
  });

  FormDetailState copyWith({
    LoadState? loadingState,
    String? errorMessage,
    String? typeId,
    String? estateFormId,
    int? status,
    FormDetailEntity? forDetail,
  }) {
    return FormDetailState(
      errorMessage: errorMessage ?? this.errorMessage,
      loadingState: loadingState ?? this.loadingState,
      status: status ?? this.status,
      forDetail: forDetail ?? this.forDetail,
      typeId: typeId ?? this.typeId,
      estateFormId: estateFormId ?? this.estateFormId,
    );
  }

}