// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'app_model.dart';

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

class AppModelAdapter extends TypeAdapter<AppModel> {
  @override
  final typeId = 0;

  @override
  AppModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return AppModel(
      isFirstRun: fields[0] == null ? true : fields[0] as bool?,
      isDarkMode: fields[1] as bool?,
      selectedModule: fields[2] as Module?,
      targetPages: (fields[3] as List?)?.cast<TargetPage>(),
    );
  }

  @override
  void write(BinaryWriter writer, AppModel obj) {
    writer
      ..writeByte(4)
      ..writeByte(0)
      ..write(obj.isFirstRun)
      ..writeByte(1)
      ..write(obj.isDarkMode)
      ..writeByte(2)
      ..write(obj.selectedModule)
      ..writeByte(3)
      ..write(obj.targetPages);
  }

  @override
  int get hashCode => typeId.hashCode;

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

class TargetPageAdapter extends TypeAdapter<TargetPage> {
  @override
  final typeId = 1;

  @override
  TargetPage read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return TargetPage(
      route: fields[0] as String?,
      functions: (fields[1] as List?)?.cast<String>(),
      module: fields[2] as Module?,
    )..selectedRole = fields[3] as String?;
  }

  @override
  void write(BinaryWriter writer, TargetPage obj) {
    writer
      ..writeByte(4)
      ..writeByte(0)
      ..write(obj.route)
      ..writeByte(1)
      ..write(obj.functions)
      ..writeByte(2)
      ..write(obj.module)
      ..writeByte(3)
      ..write(obj.selectedRole);
  }

  @override
  int get hashCode => typeId.hashCode;

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