// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'livestock_local_model.dart';

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

class LivestockLocalModelAdapter extends TypeAdapter<LivestockLocalModel> {
  @override
  final typeId = 4;

  @override
  LivestockLocalModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return LivestockLocalModel()
      ..rancher = fields[0] as RancherLocal?
      ..herd = fields[1] as HerdLocal?
      ..livestock = (fields[2] as List?)?.cast<LivestockLocal>();
  }

  @override
  void write(BinaryWriter writer, LivestockLocalModel obj) {
    writer
      ..writeByte(3)
      ..writeByte(0)
      ..write(obj.rancher)
      ..writeByte(1)
      ..write(obj.herd)
      ..writeByte(2)
      ..write(obj.livestock);
  }

  @override
  int get hashCode => typeId.hashCode;

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

class RancherLocalAdapter extends TypeAdapter<RancherLocal> {
  @override
  final typeId = 5;

  @override
  RancherLocal read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return RancherLocal()
      ..name = fields[0] as String?
      ..phone = fields[1] as String?
      ..image = fields[2] as String?;
  }

  @override
  void write(BinaryWriter writer, RancherLocal obj) {
    writer
      ..writeByte(3)
      ..writeByte(0)
      ..write(obj.name)
      ..writeByte(1)
      ..write(obj.phone)
      ..writeByte(2)
      ..write(obj.image);
  }

  @override
  int get hashCode => typeId.hashCode;

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

class HerdLocalAdapter extends TypeAdapter<HerdLocal> {
  @override
  final typeId = 6;

  @override
  HerdLocal read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return HerdLocal()
      ..location = fields[0] as LocationLocal?
      ..address = fields[1] as String?
      ..image = fields[2] as String?;
  }

  @override
  void write(BinaryWriter writer, HerdLocal obj) {
    writer
      ..writeByte(3)
      ..writeByte(0)
      ..write(obj.location)
      ..writeByte(1)
      ..write(obj.address)
      ..writeByte(2)
      ..write(obj.image);
  }

  @override
  int get hashCode => typeId.hashCode;

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

class LocationLocalAdapter extends TypeAdapter<LocationLocal> {
  @override
  final typeId = 7;

  @override
  LocationLocal read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return LocationLocal()
      ..lat = (fields[0] as num?)?.toDouble()
      ..lng = (fields[1] as num?)?.toDouble();
  }

  @override
  void write(BinaryWriter writer, LocationLocal obj) {
    writer
      ..writeByte(2)
      ..writeByte(0)
      ..write(obj.lat)
      ..writeByte(1)
      ..write(obj.lng);
  }

  @override
  int get hashCode => typeId.hashCode;

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

class LivestockLocalAdapter extends TypeAdapter<LivestockLocal> {
  @override
  final typeId = 8;

  @override
  LivestockLocal read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return LivestockLocal()
      ..species = fields[0] as String?
      ..breed = fields[1] as String?
      ..dateOfBirth = fields[2] as String?
      ..sex = fields[3] as String?
      ..motherTag = fields[4] as String?
      ..fatherTag = fields[5] as String?
      ..tagNumber = fields[6] as String?
      ..tagType = fields[7] as String?
      ..image = fields[8] as String?;
  }

  @override
  void write(BinaryWriter writer, LivestockLocal obj) {
    writer
      ..writeByte(9)
      ..writeByte(0)
      ..write(obj.species)
      ..writeByte(1)
      ..write(obj.breed)
      ..writeByte(2)
      ..write(obj.dateOfBirth)
      ..writeByte(3)
      ..write(obj.sex)
      ..writeByte(4)
      ..write(obj.motherTag)
      ..writeByte(5)
      ..write(obj.fatherTag)
      ..writeByte(6)
      ..write(obj.tagNumber)
      ..writeByte(7)
      ..write(obj.tagType)
      ..writeByte(8)
      ..write(obj.image);
  }

  @override
  int get hashCode => typeId.hashCode;

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