User.fromMap constructor
Implementation
factory User.fromMap(Map<String, dynamic> map) {
return User(
$id: map['\$id'].toString(),
$createdAt: map['\$createdAt'].toString(),
$updatedAt: map['\$updatedAt'].toString(),
name: map['name'].toString(),
password: map['password']?.toString(),
hash: map['hash']?.toString(),
hashOptions: map['hashOptions'],
registration: map['registration'].toString(),
status: map['status'],
labels: map['labels'] ?? [],
passwordUpdate: map['passwordUpdate'].toString(),
email: map['email'].toString(),
phone: map['phone'].toString(),
emailVerification: map['emailVerification'],
phoneVerification: map['phoneVerification'],
mfa: map['mfa'],
prefs: Preferences.fromMap(map['prefs']),
targets: List<Target>.from(map['targets'].map((p) => Target.fromMap(p))),
accessedAt: map['accessedAt'].toString(),
);
}