mirrored_repositories/HistoryOfMe/lib
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'diary_entry.dart';

// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************

class DiaryEntryAdapter extends TypeAdapter<DiaryEntry> {
  @override
  final int typeId = 2;

  @override
  DiaryEntry read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return DiaryEntry(
      uid: fields[0] as String,
      date: fields[1] as String,
      created: fields[2] as int,
      lastUpdated: fields[3] as int,
      title: fields[4] as String,
      content: fields[5] as String,
      moodScore: fields[6] as double,
      favorite: fields[7] as bool,
      backdropPhotoId: fields[8] as int,
      photos: (fields[9] as List?)?.cast<DiaryPhoto>(),
      visitCount: fields[10] as int?,
      editCount: fields[11] as int?,
    );
  }

  @override
  void write(BinaryWriter writer, DiaryEntry obj) {
    writer
      ..writeByte(12)
      ..writeByte(0)
      ..write(obj.uid)
      ..writeByte(1)
      ..write(obj.date)
      ..writeByte(2)
      ..write(obj.created)
      ..writeByte(3)
      ..write(obj.lastUpdated)
      ..writeByte(4)
      ..write(obj.title)
      ..writeByte(5)
      ..write(obj.content)
      ..writeByte(6)
      ..write(obj.moodScore)
      ..writeByte(7)
      ..write(obj.favorite)
      ..writeByte(8)
      ..write(obj.backdropPhotoId)
      ..writeByte(9)
      ..write(obj.photos)
      ..writeByte(10)
      ..write(obj.visitCount)
      ..writeByte(11)
      ..write(obj.editCount);
  }

  @override
  int get hashCode => typeId.hashCode;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is DiaryEntryAdapter &&
          runtimeType == other.runtimeType &&
          typeId == other.typeId;
}
