dev
dart 59 lines 1.64 KB
Raw
1 // GENERATED CODE - DO NOT MODIFY BY HAND
2
3 part of "erc20_token_legacy.dart";
4
5 // **************************************************************************
6 // TypeAdapterGenerator
7 // **************************************************************************
8
9 class Erc20TokenAdapter extends TypeAdapter<Erc20Token> {
10 @override
11 final int typeId = 12;
12
13 @override
14 Erc20Token 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 Erc20Token(
20 name: fields[0] as String,
21 symbol: fields[1] as String,
22 contractAddress: fields[2] as String,
23 decimal: fields[3] as int,
24 iconPath: fields[5] as String?,
25 tag: fields[6] as String?,
26 isPotentialScam: fields[7] == null ? false : fields[7] as bool,
27 ).._enabled = fields[4] == null ? true : fields[4] as bool;
28 }
29
30 @override
31 void write(BinaryWriter writer, Erc20Token obj) {
32 writer
33 ..writeByte(8)
34 ..writeByte(0)
35 ..write(obj.name)
36 ..writeByte(1)
37 ..write(obj.symbol)
38 ..writeByte(2)
39 ..write(obj.contractAddress)
40 ..writeByte(3)
41 ..write(obj.decimal)
42 ..writeByte(4)
43 ..write(obj._enabled)
44 ..writeByte(5)
45 ..write(obj.iconPath)
46 ..writeByte(6)
47 ..write(obj.tag)
48 ..writeByte(7)
49 ..write(obj.isPotentialScam);
50 }
51
52 @override
53 int get hashCode => typeId.hashCode;
54
55 @override
56 bool operator ==(Object other) =>
57 identical(this, other) ||
58 other is Erc20TokenAdapter && runtimeType == other.runtimeType && typeId == other.typeId;
59 }