dev
dart 60 lines 1.69 KB
Raw
1 // GENERATED CODE - DO NOT MODIFY BY HAND
2
3 part of 'template.dart';
4
5 // **************************************************************************
6 // TypeAdapterGenerator
7 // **************************************************************************
8
9 class TemplateAdapter extends TypeAdapter<Template> {
10 @override
11 final int typeId = 6;
12
13 @override
14 Template 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 Template(
20 nameRaw: fields[0] as String?,
21 isCurrencySelectedRaw: fields[5] as bool?,
22 addressRaw: fields[1] as String?,
23 cryptoCurrencyRaw: fields[2] as String?,
24 amountRaw: fields[3] as String?,
25 fiatCurrencyRaw: fields[4] as String?,
26 amountFiatRaw: fields[6] as String?,
27 additionalRecipientsRaw: (fields[7] as List?)?.cast<Template>(),
28 );
29 }
30
31 @override
32 void write(BinaryWriter writer, Template obj) {
33 writer
34 ..writeByte(8)
35 ..writeByte(0)
36 ..write(obj.nameRaw)
37 ..writeByte(1)
38 ..write(obj.addressRaw)
39 ..writeByte(2)
40 ..write(obj.cryptoCurrencyRaw)
41 ..writeByte(3)
42 ..write(obj.amountRaw)
43 ..writeByte(4)
44 ..write(obj.fiatCurrencyRaw)
45 ..writeByte(5)
46 ..write(obj.isCurrencySelectedRaw)
47 ..writeByte(6)
48 ..write(obj.amountFiatRaw)
49 ..writeByte(7)
50 ..write(obj.additionalRecipientsRaw);
51 }
52
53 @override
54 int get hashCode => typeId.hashCode;
55
56 @override
57 bool operator ==(Object other) =>
58 identical(this, other) ||
59 other is TemplateAdapter && runtimeType == other.runtimeType && typeId == other.typeId;
60 }