import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; part 'user_info_model.g.dart'; @JsonSerializable() class UserInfoModel extends Equatable { final int id; final String name; final String phone; final int havePwd; final int isVip; final int isTrial; final String tag; final int status; final int start; final int end; final List? contentRef; final List? contentCon; factory UserInfoModel.fromJson(Map json) => _$UserInfoModelFromJson(json); Map toJson() => _$UserInfoModelToJson(this); static UserInfoModel get fail => const UserInfoModel( id: 0, name: '', phone: '', havePwd: 0, 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.havePwd, 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 get props => [ id, name, phone, havePwd, 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 json) => _$ContentFromJson(json); Map toJson() => _$ContentToJson(this); @override List get props => [id, content, isChecked]; }