OTPModel.fromJson constructor
OTPModel.fromJson(
- Map<String, dynamic> json
)
Implementation
factory OTPModel.fromJson(Map<String, dynamic> json) {
return OTPModel(
id: json['id'],
token: json['token'],
phoneNumber: json['phoneNumber'],
status: OTPStatus.fromValue(json['status']),
mode: json['mode'] != null ? OTPMode.fromValue(json['mode']) : null,
appName: json['appName'],
senderId: json['senderId'],
userId: json['userId'],
createdAt:
json['createdAt'] != null ? DateTime.parse(json['createdAt']) : null,
updatedAt:
json['updatedAt'] != null ? DateTime.parse(json['updatedAt']) : null,
);
}