option_select_item.dart 503 B

12345678910111213141516171819202122
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'option_select_item.g.dart';
  3. /// 选项选择实体类
  4. @JsonSerializable()
  5. class OptionSelectItem {
  6. // 名称
  7. @JsonKey(name: 'name')
  8. String name;
  9. // 是否选中
  10. @JsonKey(name: 'selected')
  11. bool selected;
  12. OptionSelectItem(this.name, this.selected);
  13. factory OptionSelectItem.fromJson(Map<String, dynamic> json) =>
  14. _$OptionSelectItemFromJson(json);
  15. Map<String, dynamic> toJson() => _$OptionSelectItemToJson(this);
  16. }