// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'subscription_model.dart';

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

class SubscriptionModelAdapter extends TypeAdapter<SubscriptionModel> {
  @override
  final int typeId = 0;

  @override
  SubscriptionModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return SubscriptionModel(
      id: fields[0] as String,
      serviceName: fields[1] as String,
      monthlyCost: fields[2] as double,
      billingCycle: fields[3] as String,
      nextBillingDate: fields[4] as DateTime,
      isAutoDetected: fields[5] as bool,
      categoryId: fields[6] as String?,
      websiteUrl: fields[7] as String?,
      repeatCount: fields[8] as int,
      lastPaymentDate: fields[9] as DateTime?,
      currency: fields[10] as String,
      isEventActive: fields[11] as bool,
      eventStartDate: fields[12] as DateTime?,
      eventEndDate: fields[13] as DateTime?,
      eventPrice: fields[14] as double?,
      paymentCardId: fields[15] as String?,
    );
  }

  @override
  void write(BinaryWriter writer, SubscriptionModel obj) {
    writer
      ..writeByte(16)
      ..writeByte(0)
      ..write(obj.id)
      ..writeByte(1)
      ..write(obj.serviceName)
      ..writeByte(2)
      ..write(obj.monthlyCost)
      ..writeByte(3)
      ..write(obj.billingCycle)
      ..writeByte(4)
      ..write(obj.nextBillingDate)
      ..writeByte(5)
      ..write(obj.isAutoDetected)
      ..writeByte(6)
      ..write(obj.categoryId)
      ..writeByte(7)
      ..write(obj.websiteUrl)
      ..writeByte(8)
      ..write(obj.repeatCount)
      ..writeByte(9)
      ..write(obj.lastPaymentDate)
      ..writeByte(10)
      ..write(obj.currency)
      ..writeByte(11)
      ..write(obj.isEventActive)
      ..writeByte(12)
      ..write(obj.eventStartDate)
      ..writeByte(13)
      ..write(obj.eventEndDate)
      ..writeByte(14)
      ..write(obj.eventPrice)
      ..writeByte(15)
      ..write(obj.paymentCardId);
  }

  @override
  int get hashCode => typeId.hashCode;

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