import 'package:flutter_tracker/model/message_model.dart'; class UserModel { String id; // 用户id String username; //用户名 String pwd; // 密码 String nickname; int sex; // 性别:1男2女 String avatar; // 头像 int type; //类型:2商家,1顾客 UserModel( {this.id, this.username, this.nickname, this.pwd, this.sex, this.avatar, this.type}); UserModel.fromJson(Map json) { avatar = json["avatar"]; } } class UserEntity { UserModel user; MessageModel msg; UserEntity(this.user, this.msg); UserEntity.fromJson(Map json) { msg = MessageModel.fromJson(json); if (msg.success) { user = UserModel.fromJson(json); } } }