feat : segment page

This commit is contained in:
2025-07-15 09:03:11 +03:30
parent f79a3ae46f
commit b1496b1ed0
15 changed files with 63 additions and 63 deletions

View File

@@ -6,7 +6,6 @@ class DioRemote implements IHttpClient {
late Dio dio;
final AppInterceptor interceptors;
DioRemote({this.baseUrl, required this.interceptors});
@override
@@ -90,6 +89,7 @@ class DioRemote implements IHttpClient {
Map<String, String>? headers,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
T Function(Map<String, dynamic> json)? fromJson,
}) async {
final response = await dio.put(
path,
@@ -100,6 +100,11 @@ class DioRemote implements IHttpClient {
onReceiveProgress: onReceiveProgress,
cancelToken: ApiHandler.globalCancelToken,
);
if (fromJson != null && response.data is Map<String, dynamic>) {
response.data = fromJson(response.data);
return DioResponse<T>(response);
}
return DioResponse<T>(response);
}
@@ -109,6 +114,7 @@ class DioRemote implements IHttpClient {
dynamic data,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
T Function(Map<String, dynamic> json)? fromJson,
}) async {
final response = await dio.delete<T>(
path,