// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'user_model.dart';

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

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

  @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 num).toInt(),
      firstName: fields[1] as String,
      name: fields[2] as String,
      plateNumber: fields[3] as String?,
      email: fields[4] as String,
      phone: fields[5] as String,
      isParent: fields[6] == null ? false : fields[6] as bool,
      fullName: fields[7] as String,
      fullNameEmail: fields[8] as String,
      referralCode: fields[9] as String?,
      avatar: fields[10] as String?,
      departmentId: (fields[11] as num).toInt(),
      isWareHouseUser: fields[12] == null ? false : fields[12] as bool,
      wareHouseId: (fields[13] as num?)?.toInt(),
      roleId: (fields[14] as num).toInt(),
    );
  }

  @override
  void write(BinaryWriter writer, UserModel obj) {
    writer
      ..writeByte(15)
      ..writeByte(0)
      ..write(obj.id)
      ..writeByte(1)
      ..write(obj.firstName)
      ..writeByte(2)
      ..write(obj.name)
      ..writeByte(3)
      ..write(obj.plateNumber)
      ..writeByte(4)
      ..write(obj.email)
      ..writeByte(5)
      ..write(obj.phone)
      ..writeByte(6)
      ..write(obj.isParent)
      ..writeByte(7)
      ..write(obj.fullName)
      ..writeByte(8)
      ..write(obj.fullNameEmail)
      ..writeByte(9)
      ..write(obj.referralCode)
      ..writeByte(10)
      ..write(obj.avatar)
      ..writeByte(11)
      ..write(obj.departmentId)
      ..writeByte(12)
      ..write(obj.isWareHouseUser)
      ..writeByte(13)
      ..write(obj.wareHouseId)
      ..writeByte(14)
      ..write(obj.roleId);
  }

  @override
  int get hashCode => typeId.hashCode;

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