import 'package:flutter_provider_demo/model/base_model.dart'; /// Description: /// Time : 09/03/2023 Sunday /// Author : liuyuqi.gov@msn.cn class UserModel extends BaseModel { String name = ""; int age = 18; String email = ""; String password = ""; String phone = ""; String address = ""; String avator = ""; String token = ""; String createdAt = ""; UserModel({ required this.name, required this.age, required this.email, required this.password, required this.phone, required this.address, required this.avator, required this.token, required this.createdAt, }); UserModel.fromJson(Map json) { id = json['id']; name = json['name']; age = json['age']; email = json['email']; password = json['password']; phone = json['phone']; address = json['address']; avator = json['avator']; token = json['token']; createdAt = json['createdAt']; } Map toJson() { return { 'id': id, 'name': name, 'age': age, 'email': email, 'password': password, 'phone': phone, 'address': address, 'avator': avator, 'token': token, 'createdAt': createdAt, }; } } class UserEntity extends BaseEntity { UserEntity({required int code, required String msg, UserModel? data}) : super(code: code, msg: msg, data: data); UserEntity.fromJson(Map json) : super( code: int.parse(json["code"]), msg: json["msg"], ) { if (json['data'] != null) { data = UserModel.fromJson(json['data']); } } }