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.
|
|
|
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 isVip;
|
|
|
|
final int isTrial;
|
|
|
|
final String tag;
|
|
|
|
final int status;
|
|
|
|
final int start;
|
|
|
|
final int end;
|
|
|
|
final List<Content>? contentRef;
|
|
|
|
final List<Content>? contentCon;
|
|
|
|
|
|
|
|
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: '',
|
|
|
|
isVip: 0,
|
|
|
|
isTrial: 0,
|
|
|
|
tag: '',
|
|
|
|
status: 0,
|
|
|
|
start: 0,
|
|
|
|
end: 0,
|
|
|
|
contentCon: [],
|
|
|
|
contentRef: [],
|
|
|
|
);
|
|
|
|
|
|
|
|
const UserInfoModel({
|
|
|
|
required this.id,
|
|
|
|
required this.name,
|
|
|
|
required this.phone,
|
|
|
|
required this.isVip,
|
|
|
|
required this.isTrial,
|
|
|
|
required this.tag,
|
|
|
|
required this.status,
|
|
|
|
required this.start,
|
|
|
|
required this.end,
|
|
|
|
required this.contentCon,
|
|
|
|
required this.contentRef,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
List<Object?> get props => [
|
|
|
|
id,
|
|
|
|
name,
|
|
|
|
phone,
|
|
|
|
isVip,
|
|
|
|
isTrial,
|
|
|
|
tag,
|
|
|
|
status,
|
|
|
|
start,
|
|
|
|
end,
|
|
|
|
contentCon,
|
|
|
|
contentRef
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable()
|
|
|
|
class Content extends Equatable {
|
|
|
|
final int id;
|
|
|
|
final String content;
|
|
|
|
final int isChecked;
|
|
|
|
|
|
|
|
const Content({
|
|
|
|
required this.id,
|
|
|
|
required this.content,
|
|
|
|
required this.isChecked,
|
|
|
|
});
|
|
|
|
|
|
|
|
factory Content.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$ContentFromJson(json);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => _$ContentToJson(this);
|
|
|
|
|
|
|
|
@override
|
|
|
|
List<Object?> get props => [id, content, isChecked];
|
|
|
|
}
|