import 'package:json_annotation/json_annotation.dart'; import 'package:equatable/equatable.dart'; part 'user_info_model.g.dart'; @JsonSerializable() class UserInfoModel extends Equatable { final int id; final String name; final String phone; final int status; final Vip vip; factory UserInfoModel.fromJson(Map json) => _$UserInfoModelFromJson(json); Map toJson() => _$UserInfoModelToJson(this); static UserInfoModel get fail => const UserInfoModel( id: 0, name: '', phone: '', status: 0, vip: Vip(start: '', end: ''), ); @override List get props => [id, name, phone, status, vip]; const UserInfoModel({ required this.id, required this.name, required this.phone, required this.status, required this.vip, }); } @JsonSerializable() class Vip extends Equatable { final String start; final String end; const Vip({ required this.start, required this.end, }); factory Vip.fromJson(Map json) => _$VipFromJson(json); Map toJson() => _$VipToJson(this); @override List get props => [start, end]; }