You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
2.9 KiB
110 lines
2.9 KiB
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'phone_model.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
class PhoneModelAdapter extends TypeAdapter<PhoneModel> {
|
|
@override
|
|
final int typeId = 0;
|
|
|
|
@override
|
|
PhoneModel read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return PhoneModel(
|
|
title: fields[0] as String?,
|
|
time: fields[1] as String?,
|
|
state: fields[2] as bool?,
|
|
phoneList: (fields[3] as List?)?.cast<PhoneNum>(),
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, PhoneModel obj) {
|
|
writer
|
|
..writeByte(4)
|
|
..writeByte(0)
|
|
..write(obj.title)
|
|
..writeByte(1)
|
|
..write(obj.time)
|
|
..writeByte(2)
|
|
..write(obj.state)
|
|
..writeByte(3)
|
|
..write(obj.phoneList);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is PhoneModelAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class PhoneNumAdapter extends TypeAdapter<PhoneNum> {
|
|
@override
|
|
final int typeId = 1;
|
|
|
|
@override
|
|
PhoneNum read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return PhoneNum(
|
|
name: fields[0] as String?,
|
|
phone: fields[1] as String?,
|
|
state: fields[2] as bool?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, PhoneNum obj) {
|
|
writer
|
|
..writeByte(3)
|
|
..writeByte(0)
|
|
..write(obj.name)
|
|
..writeByte(1)
|
|
..write(obj.phone)
|
|
..writeByte(2)
|
|
..write(obj.state);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is PhoneNumAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
PhoneModel _$PhoneModelFromJson(Map<String, dynamic> json) => PhoneModel(
|
|
title: json['title'] as String?,
|
|
time: json['time'] as String?,
|
|
state: json['state'] as bool?,
|
|
phoneList: (json['phoneList'] as List<dynamic>?)
|
|
?.map((e) => PhoneNum.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
);
|
|
|
|
PhoneNum _$PhoneNumFromJson(Map<String, dynamic> json) => PhoneNum(
|
|
name: json['name'] as String?,
|
|
phone: json['phone'] as String?,
|
|
state: json['state'] as bool?,
|
|
);
|