You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/models/new_models/verify_otp_model.dart

42 lines
878 B
Dart

import 'package:flutter/material.dart';
class VerifyOtpModel {
final String ?userId;
final String ?userName;
final String ?email;
final String ?token;
final DateTime? validTo;
VerifyOtpModel({
this.userId,
this.userName,
this.email,
this.token,
this.validTo,
});
// Factory constructor to create an instance from a JSON map
factory VerifyOtpModel.fromJson(Map<String, dynamic> json) {
return VerifyOtpModel(
userId: json['userId'],
userName: json['userName'],
email: json['email'],
token: json['token'],
validTo: DateTime.parse(json['validTo']),
);
}
// Convert the instance to a JSON map
Map<String, dynamic> toJson() {
return {
'userId': userId,
'userName': userName,
'email': email,
'token': token,
'validTo': validTo?.toIso8601String(),
};
}
}