fix : dio call
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user