import 'package:json_annotation/json_annotation.dart';

import 'option_select_item.dart';

part 'option_select_config.g.dart';

/// 选项选择实体类
@JsonSerializable()
class OptionSelectConfig {
  // 标题
  @JsonKey(name: 'title')
  String title;

  // icon地址
  @JsonKey(name: 'iconUrl')
  String iconUrl;

  // 选项列表
  @JsonKey(name: 'options')
  List<OptionSelectItem> options;

  /// 是否自定义
  @JsonKey(name: 'isCustom')
  bool isCustom = false;

  OptionSelectConfig(
    this.title,
    this.iconUrl,
    this.options, {
    this.isCustom = false,
  });

  factory OptionSelectConfig.fromJson(Map<String, dynamic> json) =>
      _$OptionSelectConfigFromJson(json);

  Map<String, dynamic> toJson() => _$OptionSelectConfigToJson(this);
}
