import 'package:domain/generated/json/base/json_convert_content.dart';
import 'package:domain/entity/response/index_option_entity.dart';

IndexOptionEntity $IndexOptionEntityFromJson(Map<String, dynamic> json) {
  final IndexOptionEntity indexOptionEntity = IndexOptionEntity();
  final String? value = jsonConvert.convert<String>(json['value']);
  if (value != null) {
    indexOptionEntity.value = value;
  }
  final String? txt = jsonConvert.convert<String>(json['txt']);
  if (txt != null) {
    indexOptionEntity.txt = txt;
  }
  final String? selected = jsonConvert.convert<String>(json['selected']);
  if (selected != null) {
    indexOptionEntity.selected = selected;
  }
  final String? checked = jsonConvert.convert<String>(json['checked']);
  if (checked != null) {
    indexOptionEntity.checked = checked;
  }
  return indexOptionEntity;
}

Map<String, dynamic> $IndexOptionEntityToJson(IndexOptionEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['value'] = entity.value;
  data['txt'] = entity.txt;
  data['selected'] = entity.selected;
  data['checked'] = entity.checked;
  return data;
}

extension IndexOptionEntityExtension on IndexOptionEntity {
  IndexOptionEntity copyWith({
    String? value,
    String? txt,
    String? selected,
    String? checked,
  }) {
    return IndexOptionEntity()
      ..value = value ?? this.value
      ..txt = txt ?? this.txt
      ..selected = selected ?? this.selected
      ..checked = checked ?? this.checked;
  }
}