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.

56 lines
1.2 KiB

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<String, dynamic> json) =>
_$UserInfoModelFromJson(json);
Map<String, dynamic> toJson() => _$UserInfoModelToJson(this);
static UserInfoModel get fail => const UserInfoModel(
id: 0,
name: '',
phone: '',
status: 0,
vip: Vip(start: '', end: ''),
);
@override
List<Object> 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<String, dynamic> json) => _$VipFromJson(json);
Map<String, dynamic> toJson() => _$VipToJson(this);
@override
List<Object?> get props => [start, end];
}