/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2021-03-30 20:25:45
 * @LastEditTime : 2021-03-30 20:27:17
 * @FilePath     : /wisdom-huiguanjia-app/oa_package/lib/src/models/form_option_model.dart
 * @Description  : Do not edit
 */
import 'package:wisdom_cli/wisdom_ui.dart';

class FormOptionModel implements WPickerEntity {
  String? value;
  String? label;
  bool? disabled;

  FormOptionModel({
    this.value,
    this.label,
    this.disabled = false,
  });

  FormOptionModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    value = map['value'];
    label = map['label'];
    disabled = map['disabled'] ?? this.disabled;
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['value'] = this.value;
    json['label'] = this.label;
    json['disabled'] = this.disabled;

    return json;
  }

  @override
  String get selectName => this.label!;

  @override
  Object get selectUnique => this.value!;

  @override
  bool get selectDisabled => this.disabled!;
}
