class SearchHistory {
  late int id;
  late String keyword;
  late String? field; // Category, Brand ...

  SearchHistory({
    // required this.id,
    required this.keyword,
    this.field,
  });

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    // data['id'] = this.id; // AUTOINCREMENT used
    data['keyword'] = this.keyword;
    data['field'] = this.field ?? '';
    return data;
  }

  SearchHistory.fromJson(Map<dynamic, dynamic> json) {
    id = json['id'];
    keyword = json['keyword'];
    field = json['field'];
  }
}
