Line data Source code
1 : 2 : import 'package:equatable/equatable.dart'; 3 : import 'package:hive_flutter/adapters.dart'; 4 : import 'package:json_annotation/json_annotation.dart'; 5 : 6 : part 'chatwoot_contact.g.dart'; 7 : 8 : @JsonSerializable(explicitToJson: true) 9 : @HiveType(typeId: 0) 10 : class ChatwootContact extends Equatable{ 11 : 12 : static const BOX_NAME = "ChatwootContact"; 13 : 14 : @JsonKey(name: "id") 15 : @HiveField(0) 16 : final int id; 17 : 18 : @JsonKey(name: "source_id") 19 : @HiveField(1) 20 : final String? contactIdentifier; 21 : 22 : @JsonKey(name: "pubsub_token") 23 : @HiveField(2) 24 : final String pubsubToken; 25 : 26 : @JsonKey() 27 : @HiveField(3) 28 : final String name; 29 : 30 : @JsonKey() 31 : @HiveField(4) 32 : final String email; 33 : 34 8 : ChatwootContact({ 35 : required this.id, 36 : required this.contactIdentifier, 37 : required this.pubsubToken, 38 : required this.name, 39 : required this.email, 40 : }); 41 : 42 16 : factory ChatwootContact.fromJson(Map<String, dynamic> json) => _$ChatwootContactFromJson(json); 43 : 44 0 : Map<String, dynamic> toJson() => _$ChatwootContactToJson(this); 45 : 46 2 : @override 47 2 : List<Object?> get props => [ 48 2 : id, 49 2 : contactIdentifier, 50 2 : pubsubToken, 51 2 : name, 52 2 : email 53 : ]; 54 : 55 : }