appUrls method
Implementation
@override
Future<Response<BaseUrlResponse>> appUrls({
required String clientId,
required String clientSecret,
}) async {
return await _appUrlsClient
.get<Map<String, dynamic>>(
'environment-urls/get-client-urls',
queryParameters: {
'clientId': clientId,
'clientSecret': clientSecret,
},
options: Options(
headers: {'Content-Type': 'application/json'},
),
)
.then((response) {
return Response<BaseUrlResponse>(
data: BaseUrlResponse.fromJson(response.data ?? {}),
headers: response.headers,
requestOptions: response.requestOptions,
statusCode: response.statusCode,
statusMessage: response.statusMessage,
extra: response.extra,
);
})
.catchError((error) {
String errorMessage = 'Failed to get app URLs';
if (error is DioException) {
errorMessage = error.response?.data?['message'] ??
error.message ??
'Unable to fetch application URLs';
}
_showError(errorMessage);
throw error;
});
}