// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'user_model.dart';

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

class UserModelAdapter extends TypeAdapter<UserModel> {
  @override
  final int typeId = 0;

  @override
  UserModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return UserModel(
      id: fields[0] as String,
      email: fields[1] as String,
      displayName: fields[2] as String?,
      photoUrl: fields[3] as String?,
      phoneNumber: fields[7] as String?,
      preferences: fields[4] as UserPreferences,
      createdAt: fields[5] as DateTime,
      updatedAt: fields[6] as DateTime,
      isSetupComplete: fields[8] as bool,
      nickname: fields[9] as String?,
      gender: fields[10] as String?,
      address: fields[11] as String?,
      lastCheckinDate: fields[12] as DateTime?,
      dailyPreferences: (fields[13] as Map?)?.cast<String, dynamic>(),
    );
  }

  @override
  void write(BinaryWriter writer, UserModel obj) {
    writer
      ..writeByte(14)
      ..writeByte(0)
      ..write(obj.id)
      ..writeByte(1)
      ..write(obj.email)
      ..writeByte(2)
      ..write(obj.displayName)
      ..writeByte(3)
      ..write(obj.photoUrl)
      ..writeByte(4)
      ..write(obj.preferences)
      ..writeByte(5)
      ..write(obj.createdAt)
      ..writeByte(6)
      ..write(obj.updatedAt)
      ..writeByte(7)
      ..write(obj.phoneNumber)
      ..writeByte(8)
      ..write(obj.isSetupComplete)
      ..writeByte(9)
      ..write(obj.nickname)
      ..writeByte(10)
      ..write(obj.gender)
      ..writeByte(11)
      ..write(obj.address)
      ..writeByte(12)
      ..write(obj.lastCheckinDate)
      ..writeByte(13)
      ..write(obj.dailyPreferences);
  }

  @override
  int get hashCode => typeId.hashCode;

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

class UserPreferencesAdapter extends TypeAdapter<UserPreferences> {
  @override
  final int typeId = 1;

  @override
  UserPreferences read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return UserPreferences(
      favoriteCategories: (fields[0] as List).cast<String>(),
      allergies: (fields[1] as List).cast<String>(),
      mood: fields[2] as String,
      spiceLevel: fields[3] as String,
      dietaryRestriction: fields[4] as String,
      budgetRange: fields[5] as int,
      enableNotifications: fields[6] as bool,
      language: fields[7] as String,
      ageRange: fields[8] as String?,
    );
  }

  @override
  void write(BinaryWriter writer, UserPreferences obj) {
    writer
      ..writeByte(9)
      ..writeByte(0)
      ..write(obj.favoriteCategories)
      ..writeByte(1)
      ..write(obj.allergies)
      ..writeByte(2)
      ..write(obj.mood)
      ..writeByte(3)
      ..write(obj.spiceLevel)
      ..writeByte(4)
      ..write(obj.dietaryRestriction)
      ..writeByte(5)
      ..write(obj.budgetRange)
      ..writeByte(6)
      ..write(obj.enableNotifications)
      ..writeByte(7)
      ..write(obj.language)
      ..writeByte(8)
      ..write(obj.ageRange);
  }

  @override
  int get hashCode => typeId.hashCode;

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