User.fromJson constructor
Implementation
factory User.fromJson(Map<String, dynamic> map) {
return User(
id: DbQueryField.tryParseObjectId(map['_id']),
bsid: DbQueryField.tryParseObjectId(map['_bsid']),
time: DbQueryField.tryParseInt(map['_time']),
extra: map['_extra'] is Map ? DbJsonWraper.fromJson(map['_extra']) : map['_extra'],
trans: (map['_trans'] as List?)?.map((v) => DbQueryField.parseObjectId(v)).toList(),
phone: DbQueryField.tryParseString(map['phone']),
token: DbQueryField.tryParseString(map['token']),
rmbpwd: DbQueryField.tryParseString(map['rmbpwd']),
rmbfen: DbQueryField.tryParseInt(map['rmbfen']),
thirdTp: DbQueryField.tryParseInt(map['thirdTp']),
thirdNo: DbQueryField.tryParseString(map['thirdNo']),
customType: DbQueryField.tryParseInt(map['customType']),
name: DbQueryField.tryParseString(map['name']),
card: DbQueryField.tryParseString(map['card']),
birth: DbQueryField.tryParseString(map['birth']),
sex: DbQueryField.tryParseInt(map['sex']),
country: DbQueryField.tryParseString(map['country']),
province: DbQueryField.tryParseString(map['province']),
city: DbQueryField.tryParseString(map['city']),
district: DbQueryField.tryParseString(map['district']),
location: map['location'] is Map ? Location.fromJson(map['location']) : map['location'],
login: DbQueryField.tryParseInt(map['login']),
ip: DbQueryField.tryParseString(map['ip']),
no: DbQueryField.tryParseString(map['no']),
pwd: DbQueryField.tryParseString(map['pwd']),
nick: DbQueryField.tryParseString(map['nick']),
desc: DbQueryField.tryParseString(map['desc']),
icon: DbQueryField.tryParseString(map['icon']),
head: (map['head'] as List?)?.map((v) => DbQueryField.parseString(v)).toList(),
byfind: DbQueryField.tryParseBool(map['byfind']),
bycode: DbQueryField.tryParseBool(map['bycode']),
bycard: DbQueryField.tryParseBool(map['bycard']),
byteam: DbQueryField.tryParseBool(map['byteam']),
notice: DbQueryField.tryParseBool(map['notice']),
silent: DbQueryField.tryParseBool(map['silent']),
deny: DbQueryField.tryParseInt(map['deny']),
);
}