// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'daily_worship_log.dart';

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

class DailyWorshipLogAdapter extends TypeAdapter<DailyWorshipLog> {
  @override
  final int typeId = 2;

  @override
  DailyWorshipLog read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    Map<String, ShalatLog>? parsedShalatLogs;
    try {
      parsedShalatLogs = (fields[1] as Map?)?.cast<String, ShalatLog>();
    } catch (_) {
      // If casting fails (e.g. it was the old Map<String, bool>), ignore it.
      parsedShalatLogs = {};
    }

    return DailyWorshipLog(
      date: fields[0] as String,
      shalatLogs: parsedShalatLogs,
      tilawahLog: fields[5] as TilawahLog?,
      dzikirLog: fields[6] as DzikirLog?,
      puasaLog: fields[7] as PuasaLog?,
      totalItems: fields[2] as int,
      completedCount: fields[3] as int,
      completionPercent: fields[4] as double,
    );
  }

  @override
  void write(BinaryWriter writer, DailyWorshipLog obj) {
    writer
      ..writeByte(8)
      ..writeByte(0)
      ..write(obj.date)
      ..writeByte(1)
      ..write(obj.shalatLogs)
      ..writeByte(5)
      ..write(obj.tilawahLog)
      ..writeByte(6)
      ..write(obj.dzikirLog)
      ..writeByte(7)
      ..write(obj.puasaLog)
      ..writeByte(2)
      ..write(obj.totalItems)
      ..writeByte(3)
      ..write(obj.completedCount)
      ..writeByte(4)
      ..write(obj.completionPercent);
  }

  @override
  int get hashCode => typeId.hashCode;

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