Line data Source code
1 : import 'package:chatwoot_client_sdk/chatwoot_client_sdk.dart'; 2 : import 'package:chatwoot_client_sdk/data/local/entity/chatwoot_contact.dart'; 3 : import 'package:chatwoot_client_sdk/data/local/local_storage.dart'; 4 : import 'package:equatable/equatable.dart'; 5 : import 'package:hive/hive.dart'; 6 : import 'package:json_annotation/json_annotation.dart'; 7 : part 'chatwoot_conversation.g.dart'; 8 : 9 : @JsonSerializable(explicitToJson: true) 10 : @HiveType(typeId: CHATWOOT_CONVERSATION_HIVE_TYPE_ID) 11 : class ChatwootConversation extends Equatable { 12 : ///The numeric ID of the conversation 13 : @JsonKey() 14 : @HiveField(0) 15 : final int id; 16 : 17 : ///The numeric ID of the inbox 18 : @JsonKey(name: "inbox_id") 19 : @HiveField(1) 20 : final int inboxId; 21 : 22 : ///List of all messages from the conversation 23 : @JsonKey() 24 : @HiveField(2) 25 : final List<ChatwootMessage> messages; 26 : 27 : ///Contact of the conversation 28 : @JsonKey() 29 : @HiveField(3) 30 : final ChatwootContact contact; 31 : 32 6 : ChatwootConversation( 33 : {required this.id, 34 : required this.inboxId, 35 : required this.messages, 36 : required this.contact}); 37 : 38 6 : factory ChatwootConversation.fromJson(Map<String, dynamic> json) => 39 6 : _$ChatwootConversationFromJson(json); 40 : 41 0 : Map<String, dynamic> toJson() => _$ChatwootConversationToJson(this); 42 : 43 2 : @override 44 10 : List<Object?> get props => [id, inboxId, messages, contact]; 45 : }