dev
dart 80 lines 2.21 KB
Raw
1 // GENERATED CODE - DO NOT MODIFY BY HAND
2
3 part of 'anonpay_invoice_info.dart';
4
5 // **************************************************************************
6 // TypeAdapterGenerator
7 // **************************************************************************
8
9 class AnonpayInvoiceInfoAdapter extends TypeAdapter<AnonpayInvoiceInfo> {
10 @override
11 final int typeId = 10;
12
13 @override
14 AnonpayInvoiceInfo read(BinaryReader reader) {
15 final numOfFields = reader.readByte();
16 final fields = <int, dynamic>{
17 for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
18 };
19 return AnonpayInvoiceInfo(
20 invoiceId: fields[0] as String,
21 clearnetUrl: fields[7] as String,
22 onionUrl: fields[8] as String,
23 clearnetStatusUrl: fields[9] as String,
24 onionStatusUrl: fields[10] as String,
25 status: fields[1] as String,
26 fiatAmount: fields[2] as double?,
27 fiatEquiv: fields[3] as String?,
28 amountTo: fields[4] as double?,
29 coinTo: fields[5] as String,
30 address: fields[6] as String,
31 createdAt: fields[11] as DateTime,
32 walletId: fields[12] as String,
33 provider: fields[13] as String,
34 );
35 }
36
37 @override
38 void write(BinaryWriter writer, AnonpayInvoiceInfo obj) {
39 writer
40 ..writeByte(14)
41 ..writeByte(0)
42 ..write(obj.invoiceId)
43 ..writeByte(1)
44 ..write(obj.status)
45 ..writeByte(2)
46 ..write(obj.fiatAmount)
47 ..writeByte(3)
48 ..write(obj.fiatEquiv)
49 ..writeByte(4)
50 ..write(obj.amountTo)
51 ..writeByte(5)
52 ..write(obj.coinTo)
53 ..writeByte(6)
54 ..write(obj.address)
55 ..writeByte(7)
56 ..write(obj.clearnetUrl)
57 ..writeByte(8)
58 ..write(obj.onionUrl)
59 ..writeByte(9)
60 ..write(obj.clearnetStatusUrl)
61 ..writeByte(10)
62 ..write(obj.onionStatusUrl)
63 ..writeByte(11)
64 ..write(obj.createdAt)
65 ..writeByte(12)
66 ..write(obj.walletId)
67 ..writeByte(13)
68 ..write(obj.provider);
69 }
70
71 @override
72 int get hashCode => typeId.hashCode;
73
74 @override
75 bool operator ==(Object other) =>
76 identical(this, other) ||
77 other is AnonpayInvoiceInfoAdapter &&
78 runtimeType == other.runtimeType &&
79 typeId == other.typeId;
80 }