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