// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'user_local_model.dart';

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

class UserLocalModelAdapter extends TypeAdapter<UserLocalModel> {
  @override
  final typeId = 0;

  @override
  UserLocalModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return UserLocalModel(
      username: fields[0] as String?,
      password: fields[1] as String?,
      token: fields[2] as String?,
      refreshToken: fields[3] as String?,
      name: fields[4] as String?,
      module: fields[5] as Module?,
      backend: fields[6] as String?,
      apiKey: fields[7] as String?,
    );
  }

  @override
  void write(BinaryWriter writer, UserLocalModel obj) {
    writer
      ..writeByte(8)
      ..writeByte(0)
      ..write(obj.username)
      ..writeByte(1)
      ..write(obj.password)
      ..writeByte(2)
      ..write(obj.token)
      ..writeByte(3)
      ..write(obj.refreshToken)
      ..writeByte(4)
      ..write(obj.name)
      ..writeByte(5)
      ..write(obj.module)
      ..writeByte(6)
      ..write(obj.backend)
      ..writeByte(7)
      ..write(obj.apiKey);
  }

  @override
  int get hashCode => typeId.hashCode;

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

class ModuleAdapter extends TypeAdapter<Module> {
  @override
  final typeId = 1;

  @override
  Module read(BinaryReader reader) {
    switch (reader.readByte()) {
      case 0:
        return Module.liveStocks;
      case 1:
        return Module.inspection;
      case 2:
        return Module.chicken;
      default:
        return Module.liveStocks;
    }
  }

  @override
  void write(BinaryWriter writer, Module obj) {
    switch (obj) {
      case Module.liveStocks:
        writer.writeByte(0);
      case Module.inspection:
        writer.writeByte(1);
      case Module.chicken:
        writer.writeByte(2);
    }
  }

  @override
  int get hashCode => typeId.hashCode;

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