UserModel.fromMap constructor
UserModel.fromMap( - Map snapshot
)
Implementation
UserModel.fromMap(Map snapshot)
: type = snapshot['type'] as String?,
organizationId = snapshot['organizationId'] as String?,
organizationName = snapshot['organizationName'] as String?,
name = snapshot['name'] as String?,
email = snapshot['email'] as String?,
mobileNo = snapshot['mobileNo'] as int?,
uid = snapshot['uid'] as String?,
notificationToken = snapshot['notificationToken'] as String?,
delete = snapshot['delete'] as bool? ?? false,
createdOn = snapshot['createdOn'] is DateTime
? snapshot['createdOn']
: null,
createdBy = snapshot['createdBy'] as String?,
associations = _safeMap(snapshot['associations']),
bulletin = _safeMap(snapshot['bulletin']),
age = snapshot['age'] as int?,
autoModifiedTimeStamp = snapshot['autoModifiedTimeStamp'] as DateTime?,
deviceId = snapshot['deviceId'] as String?,
deviceName = snapshot['deviceName'] as String?,
doctorId = snapshot['doctorId'] as String?,
amcLog = snapshot['amcLog'] as List<dynamic>?,
amcPayment = snapshot['amcPayment'],
amcStartDate = snapshot['amcStartDate'] as String?,
amcValidity = snapshot['amcValidity'] as String?,
appVersion = snapshot['appVersion'] as String?,
deviceCode = snapshot['deviceCode'] as String?,
isActive = snapshot['isActive'] as bool?,
lastSeenTime = snapshot['lastSeenTime'] as String?,
modifiedAt = snapshot['modifiedAt'] as DateTime?,
modifiedTimeStamp = snapshot['modifiedTimeStamp'] as String?,
noOfMother = snapshot['noOfMother'] as int?,
noOfTests = snapshot['noOfTests'] as int?,
sync = snapshot['sync'] as int?,
testAccount = snapshot['testAccount'] as bool?,
weight = (snapshot['weight'] is int)
? (snapshot['weight'] as int).toDouble()
: snapshot['weight'] as double?,
patientId = snapshot['patientId'] as String?,
platformId = snapshot['platformId'] as String?,
platformRegAt = snapshot['platformRegAt'] as String?,
documentId = snapshot['documentId'] as String?,
organizationNameBabyBeat =
snapshot['organizationNameBabyBeat'] as String?,
babyBeatAssociation = _safeMap(snapshot['babyBeatAssociation']);