fix : dio call

This commit is contained in:
2025-05-17 09:08:46 +03:30
parent 3a017b5956
commit b5d6055aa7
6 changed files with 159 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/foundation.dart';
import 'package:rasadyar_core/core.dart';
typedef AsyncCallback<T> = Future<T> Function();
typedef ErrorCallback = void Function(dynamic error, StackTrace? stackTrace);
@@ -27,12 +28,14 @@ Future<T?> safeCall<T>({
final result = await call();
iLog(result.toString());
if (showSuccess) {
(onShowSuccessMessage ?? _defaultShowSuccessMessage)();
}
onSuccess?.call(result);
return result; // اضافه کردن بازگشت نتیجه
return result;
} catch (error, stackTrace) {
if (showError) {