// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'user_profile.dart';

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

class UserProfileAdapter extends TypeAdapter<UserProfile> {
  @override
  final int typeId = 1;

  @override
  UserProfile read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return UserProfile(
      fontPreference: fields[0] as String,
      displayMode: fields[5] as String,
      createdAt: fields[3] as DateTime,
      updatedAt: fields[4] as DateTime?,
      mbti: fields[6] as String?,
      sakePersonaMbti: fields[21] as String?,
      birthdate: fields[7] as DateTime?,
      themeMode: fields[8] as String,
      isBusinessMode: fields[9] == null ? false : fields[9] as bool,
      defaultMarkup: fields[10] == null ? 3.0 : fields[10] as double,
      hasCompletedOnboarding: fields[11] == null ? false : fields[11] as bool,
      nickname: fields[12] as String?,
      gender: fields[13] as String?,
      totalExp: fields[14] == null ? 0 : fields[14] as int,
      unlockedBadges:
          fields[15] == null ? [] : (fields[15] as List).cast<String>(),
      locale: fields[19] == null ? 'ja' : fields[19] as String,
      colorVariant:
          fields[20] == null ? 'washi_sumi_kohaku' : fields[20] as String,
    );
  }

  @override
  void write(BinaryWriter writer, UserProfile obj) {
    writer
      ..writeByte(17)
      ..writeByte(0)
      ..write(obj.fontPreference)
      ..writeByte(3)
      ..write(obj.createdAt)
      ..writeByte(4)
      ..write(obj.updatedAt)
      ..writeByte(5)
      ..write(obj.displayMode)
      ..writeByte(6)
      ..write(obj.mbti)
      ..writeByte(21)
      ..write(obj.sakePersonaMbti)
      ..writeByte(7)
      ..write(obj.birthdate)
      ..writeByte(8)
      ..write(obj.themeMode)
      ..writeByte(9)
      ..write(obj.isBusinessMode)
      ..writeByte(10)
      ..write(obj.defaultMarkup)
      ..writeByte(11)
      ..write(obj.hasCompletedOnboarding)
      ..writeByte(12)
      ..write(obj.nickname)
      ..writeByte(13)
      ..write(obj.gender)
      ..writeByte(14)
      ..write(obj.totalExp)
      ..writeByte(15)
      ..write(obj.unlockedBadges)
      ..writeByte(19)
      ..write(obj.locale)
      ..writeByte(20)
      ..write(obj.colorVariant);
  }

  @override
  int get hashCode => typeId.hashCode;

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