feat : login api call

This commit is contained in:
2025-05-17 15:24:06 +03:30
parent 0e630e709b
commit 303ff86d85
22 changed files with 518 additions and 522 deletions

View File

@@ -1,3 +1,4 @@
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:rasadyar_core/core.dart';
@@ -6,7 +7,7 @@ typedef ErrorCallback = void Function(dynamic error, StackTrace? stackTrace);
typedef VoidCallback = void Function();
// تعریف دقیق تابع safeCall
Future<T?> safeCall<T>({
Future<void> safeCall<T>({
required AsyncCallback<T> call,
Function(T result)? onSuccess,
ErrorCallback? onError,
@@ -33,7 +34,7 @@ Future<T?> safeCall<T>({
}
onSuccess?.call(result);
return result;
} catch (error, stackTrace) {
if (showError) {
@@ -45,7 +46,6 @@ Future<T?> safeCall<T>({
print('safeCall error: $error\n$stackTrace');
}
return null;
} finally {
if (showLoading) {
(onHideLoading ?? _defaultHideLoading)();