import 'package:json_annotation/json_annotation.dart';

part 'template_bean.g.dart';

@JsonSerializable()
class TemplateBean {
  @JsonKey(name: 'id')
  int? id;

  @JsonKey(name: 'name')
  String? name;

  @JsonKey(name: 'titles')
  List<String>? titles;

  @JsonKey(name: 'defaultTitle')
  String? defaultTitle;

  @JsonKey(ignore: true)
  bool isDefaultTemp = false;

  TemplateBean({this.id, this.name, this.titles, this.defaultTitle});

  setDefaultTemp(bool isDefault) {
    isDefaultTemp = isDefault;
  }

  factory TemplateBean.fromJson(Map<String, dynamic> json) =>
      _$TemplateBeanFromJson(json);
}
