import 'package:equatable/equatable.dart'; import 'package:hive/hive.dart'; import 'package:json_annotation/json_annotation.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? phoneList; factory PhoneModel.fromJson(Map json) => _$PhoneModelFromJson(json); PhoneModel({ this.title, this.time, this.state, this.phoneList, }); @override List 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 json) => _$PhoneNumFromJson(json); PhoneNum({ this.name, this.phone, this.state, }); @override List get props => [name, phone, state]; }