// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'quran_bookmark.dart';

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

class QuranBookmarkAdapter extends TypeAdapter<QuranBookmark> {
  @override
  final int typeId = 4;

  @override
  QuranBookmark read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return QuranBookmark(
      surahId: fields[0] as int,
      verseId: fields[1] as int,
      surahName: fields[2] as String,
      verseText: fields[3] as String,
      savedAt: fields[4] as DateTime,
      isLastRead: fields[5] as bool? ?? false,
      verseLatin: fields[6] as String?,
      verseTranslation: fields[7] as String?,
    );
  }

  @override
  void write(BinaryWriter writer, QuranBookmark obj) {
    writer
      ..writeByte(8)
      ..writeByte(0)
      ..write(obj.surahId)
      ..writeByte(1)
      ..write(obj.verseId)
      ..writeByte(2)
      ..write(obj.surahName)
      ..writeByte(3)
      ..write(obj.verseText)
      ..writeByte(4)
      ..write(obj.savedAt)
      ..writeByte(5)
      ..write(obj.isLastRead)
      ..writeByte(6)
      ..write(obj.verseLatin)
      ..writeByte(7)
      ..write(obj.verseTranslation);
  }

  @override
  int get hashCode => typeId.hashCode;

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