Files
GitJournal/lib/core/link.g.dart
Vishesh Handa 665d1dce2b Add a Materialized View for the Links
Calculating the links is very expensive, this way we finally don't need
to do it each time!
2021-09-06 16:57:30 +02:00

53 lines
1.3 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'link.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class LinkAdapter extends TypeAdapter<Link> {
@override
final int typeId = 0;
@override
Link read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Link(
publicTerm: fields[0] as String?,
filePath: fields[1] as String?,
headingID: fields[2] as String?,
alt: fields[3] as String?,
)..wikiTerm = fields[5] as String?;
}
@override
void write(BinaryWriter writer, Link obj) {
writer
..writeByte(5)
..writeByte(0)
..write(obj.publicTerm)
..writeByte(1)
..write(obj.filePath)
..writeByte(2)
..write(obj.headingID)
..writeByte(3)
..write(obj.alt)
..writeByte(5)
..write(obj.wikiTerm);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is LinkAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}