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.
55 lines
1.0 KiB
55 lines
1.0 KiB
2 years ago
|
import 'package:hive/hive.dart';
|
||
|
import 'package:json_annotation/json_annotation.dart';
|
||
|
import 'package:equatable/equatable.dart';
|
||
|
|
||
|
part 'phone_model.g.dart';
|
||
|
|
||
|
@JsonSerializable()
|
||
|
@HiveType(typeId: 0)
|
||
|
class PhoneModel extends Equatable {
|
||
|
@HiveField(0)
|
||
|
String? title;
|
||
|
@HiveField(1)
|
||
|
String? time;
|
||
|
@HiveField(2)
|
||
|
bool? state;
|
||
|
@HiveField(3)
|
||
|
List<PhoneNum>? phoneList;
|
||
|
|
||
|
factory PhoneModel.fromJson(Map<String, dynamic> json) =>
|
||
|
_$PhoneModelFromJson(json);
|
||
|
|
||
|
PhoneModel({
|
||
|
this.title,
|
||
|
this.time,
|
||
|
this.state,
|
||
|
this.phoneList,
|
||
|
});
|
||
|
|
||
|
@override
|
||
|
List<Object?> get props => [title, time, state, phoneList];
|
||
|
}
|
||
|
|
||
|
@JsonSerializable()
|
||
|
@HiveType(typeId: 1)
|
||
|
class PhoneNum extends Equatable {
|
||
|
@HiveField(0)
|
||
|
String? name;
|
||
|
@HiveField(1)
|
||
|
String? phone;
|
||
|
@HiveField(2)
|
||
|
bool? state;
|
||
|
|
||
|
factory PhoneNum.fromJson(Map<String, dynamic> json) =>
|
||
|
_$PhoneNumFromJson(json);
|
||
|
|
||
|
PhoneNum({
|
||
|
this.name,
|
||
|
this.phone,
|
||
|
this.state,
|
||
|
});
|
||
|
|
||
|
@override
|
||
|
List<Object?> get props => [name, phone, state];
|
||
|
}
|