fix : new ui changes

This commit is contained in:
2025-07-21 15:06:19 +03:30
parent e2300293a7
commit 99503a2d72
12 changed files with 66 additions and 29 deletions

View File

@@ -128,6 +128,12 @@ class DioRemote implements IHttpClient {
options: Options(headers: headers),
cancelToken: ApiHandler.globalCancelToken,
);
if (fromJson != null) {
final rawData = response.data;
final parsedData = rawData is Map<String, dynamic> ? fromJson(rawData) : null;
response.data = parsedData;
return DioResponse<T>(response);
}
return DioResponse<T>(response);
}

View File

@@ -60,6 +60,7 @@ Future<T?> gSafeCall<T>({
} catch (error, stackTrace) {
retryCount++;
eLog('Error in gSafeCall: $error, retryCount: $retryCount , stackTrace : $stackTrace ');
if (error is DioException && error.response?.statusCode == 401) {
if (showError) {
@@ -79,7 +80,7 @@ Future<T?> gSafeCall<T>({
return null;
}
// صبر قبل از retry
if (retryCount <= maxRetries) {
await Future.delayed(retryDelay);
}