import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
import 'package:domain/entity/service_repair_detail_entity.dart';
import 'package:flutter/cupertino.dart';
import 'package:widgets/load_state_layout.dart';

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

  final int? id;
  final String? type;

  String? userNotes;  // 取消的文字
  Map<String, Map<String, dynamic>> getQuoteFormData;

  ServiceRepairDetailEntity? datas;

  ServiceRepairDetailState({
    this.loadingState = LoadState.State_Loading,
    this.errorMessage,
    this.id,
    this.type,
    required this.datas,
    this.userNotes,
    Map<String, Map<String, dynamic>>? getQuoteFormData,
  }): getQuoteFormData = getQuoteFormData ?? {
    "userNotes": {
      'value': '',
      'controller': TextEditingController(),
      'hintText': '',
      'focusNode': FocusNode(),
      'obsecure': false,
    },
  };

  ServiceRepairDetailState copyWith({
    ServiceRepairDetailEntity? datas,
    LoadState? loadingState,
    String? errorMessage,
    int? id,
    String? type,
    String? userNotes,
    Map<String, Map<String, dynamic>>? getQuoteFormData,
  }) {
    return ServiceRepairDetailState(
      loadingState: loadingState ?? this.loadingState,
      errorMessage: errorMessage ?? this.errorMessage,
      id: id ?? this.id,
      type: type ?? this.type,
      datas: datas?? this.datas,
      userNotes: userNotes ?? this.userNotes,
      getQuoteFormData: getQuoteFormData ?? this.getQuoteFormData,
    );
  }
}