24 lines
544 B
Dart
24 lines
544 B
Dart
// login_model.dart
|
|
|
|
class LoginModel {
|
|
String? mobile;
|
|
String? otp;
|
|
|
|
LoginModel({this.mobile, this.otp});
|
|
|
|
// For sending mobile number to request OTP
|
|
Map<String, dynamic> toJsonMobile() {
|
|
return {'mobile': mobile};
|
|
}
|
|
|
|
// For sending mobile + OTP for verification
|
|
Map<String, dynamic> toJsonOtp() {
|
|
return {'mobile': mobile, 'otp': otp};
|
|
}
|
|
|
|
// Response from API
|
|
factory LoginModel.fromJson(Map<String, dynamic> json) {
|
|
return LoginModel(mobile: json['mobile'], otp: json['otp']);
|
|
}
|
|
}
|