Team.fromJson constructor
Implementation
factory Team.fromJson(Map<String, dynamic> map) {
return Team(
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(),
owner: DbQueryField.tryParseObjectId(map['owner']),
admin: (map['admin'] as List?)?.map((v) => DbQueryField.parseObjectId(v)).toList(),
member: DbQueryField.tryParseInt(map['member']),
appSecret: DbQueryField.tryParseString(map['appSecret']),
appHosts: (map['appHosts'] as List?)?.map((v) => DbQueryField.parseString(v)).toList(),
appMenus: (map['appMenus'] as List?)?.map((v) => DbJsonWraper.fromJson(v)).toList(),
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']),
);
}