DeviceModel.fromJson constructor
Implementation
factory DeviceModel.fromJson(Map<String, dynamic> json) {
return DeviceModel(
id: json['id'],
deviceId: json['deviceId'],
type: DeviceType.fromValue(json['type']),
notificationToken: json['notificationToken'],
userId: json['userId'],
companyId: json['companyId'],
createdAt: DateTime.parse(json['createdAt']),
updatedAt: json['updatedAt'] != null
? DateTime.parse(json['updatedAt'])
: null,
);
}