refreshToken method
Implementation
@override
Future<Map> refreshToken(String clientId, String clientSecret,
String grantType, String refreshToken) async {
final String baseUrl = await getBaseUrl;
var url = Uri.parse("$baseUrl/oauth/token");
var bodyData = {
"client_id": clientId,
"client_secret": clientSecret,
"grant_type": grantType,
"refresh_token": refreshToken
};
var jsonBody = jsonEncode(bodyData);
var response = await http.post(
url,
headers: {"Content-Type": "application/x-www-form-urlencoded"},
body: jsonBody,
);
var data = jsonDecode(response.body);
return data;
}