class LoginModel { String email; String password; LoginModel({required this.email, required this.password}); // For converting to JSON Map toJson() { return { 'email': email, 'password': password, }; } // For creating an instance from JSON factory LoginModel.fromJson(Map json) { return LoginModel( email: json['email'] ?? '', password: json['password'] ?? '', ); } }