class LoginModel { String username; String password; String clientId; String grantType; LoginModel({ required this.username, required this.password, this.clientId = "", this.grantType = "password", }); factory LoginModel.fromJson(Map json) { return LoginModel( username: json['username'], password: json['password'], clientId: json['clientId'], grantType: json['grantType'], ); } Map toJson() { return { 'username': username, 'password': password, 'clientId': clientId, 'grantType': grantType, }; } }