mpin add and 2026-04-19 updates

This commit is contained in:
mageshwaran committed 2026-04-19 21:44:01 +05:30
1 parent 41d7cfa8c6
commit 7d25e77138
15 files changed
+2555 -1643

No files matched your search

+38 -23
View File
@@ -1,23 +1,38 @@
// 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']);
}
}
// login_model.dart
class LoginModel {
String? email;
String? pin;
String? mobile;
String? otp;
LoginModel({this.email, this.pin, this.mobile, this.otp});
// For sending mobile number to request OTP (Legacy)
Map<String, dynamic> toJsonMobile() {
return {'mobile': mobile};
}
// For sending mobile + OTP for verification (Legacy)
Map<String, dynamic> toJsonOtp() {
return {'mobile': mobile, 'otp': otp};
}
// For Email + PIN Login
Map<String, dynamic> toJsonEmailPin() {
return {
'email': email,
'pin': pin,
};
}
// Response from API
factory LoginModel.fromJson(Map<String, dynamic> json) {
return LoginModel(
email: json['email'],
pin: json['pin'],
mobile: json['mobile'],
otp: json['otp'],
);
}
}