Line data Source code
1 : // GENERATED CODE - DO NOT MODIFY BY HAND 2 : 3 : part of 'chatwoot_conversation.dart'; 4 : 5 : // ************************************************************************** 6 : // TypeAdapterGenerator 7 : // ************************************************************************** 8 : 9 : class ChatwootConversationAdapter extends TypeAdapter<ChatwootConversation> { 10 : @override 11 : final int typeId = 1; 12 : 13 0 : @override 14 : ChatwootConversation read(BinaryReader reader) { 15 0 : final numOfFields = reader.readByte(); 16 0 : final fields = <int, dynamic>{ 17 0 : for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), 18 : }; 19 0 : return ChatwootConversation( 20 0 : id: fields[0] as int, 21 0 : inboxId: fields[1] as int, 22 0 : messages: (fields[2] as List).cast<ChatwootMessage>(), 23 0 : contact: fields[3] as ChatwootContact, 24 : ); 25 : } 26 : 27 1 : @override 28 : void write(BinaryWriter writer, ChatwootConversation obj) { 29 : writer 30 1 : ..writeByte(4) 31 1 : ..writeByte(0) 32 2 : ..write(obj.id) 33 1 : ..writeByte(1) 34 2 : ..write(obj.inboxId) 35 1 : ..writeByte(2) 36 2 : ..write(obj.messages) 37 1 : ..writeByte(3) 38 2 : ..write(obj.contact); 39 : } 40 : 41 0 : @override 42 0 : int get hashCode => typeId.hashCode; 43 : 44 0 : @override 45 : bool operator ==(Object other) => 46 : identical(this, other) || 47 0 : other is ChatwootConversationAdapter && 48 0 : runtimeType == other.runtimeType && 49 0 : typeId == other.typeId; 50 : } 51 : 52 : // ************************************************************************** 53 : // JsonSerializableGenerator 54 : // ************************************************************************** 55 : 56 6 : ChatwootConversation _$ChatwootConversationFromJson(Map<String, dynamic> json) { 57 6 : return ChatwootConversation( 58 6 : id: json['id'] as int, 59 6 : inboxId: json['inbox_id'] as int, 60 6 : messages: (json['messages'] as List<dynamic>) 61 8 : .map((e) => ChatwootMessage.fromJson(e as Map<String, dynamic>)) 62 6 : .toList(), 63 12 : contact: ChatwootContact.fromJson(json['contact'] as Map<String, dynamic>), 64 : ); 65 : } 66 : 67 0 : Map<String, dynamic> _$ChatwootConversationToJson( 68 : ChatwootConversation instance) => 69 0 : <String, dynamic>{ 70 0 : 'id': instance.id, 71 0 : 'inbox_id': instance.inboxId, 72 0 : 'messages': instance.messages.map((e) => e.toJson()).toList(), 73 0 : 'contact': instance.contact.toJson(), 74 : };