Update: 2026-05-07 11:52:29

This commit is contained in:
Hamza-Ayed
2026-05-07 11:52:30 +03:00
parent bd7164ed23
commit b8d9b3343e
4 changed files with 12 additions and 61 deletions

View File

@@ -87,7 +87,7 @@ class DashboardController extends GetxController {
Container(
width: 40,
height: 4,
margin: const EdgeInsets.bottom(20),
margin: const EdgeInsets.only(bottom: 20),
decoration: BoxDecoration(
color: Colors.grey.withOpacity(0.3),
borderRadius: BorderRadius.circular(2)),
@@ -171,10 +171,18 @@ class DashboardController extends GetxController {
AppSnackbar.showError(
'خطأ', response.data['message'] ?? 'فشل تحليل الطلب');
}
} on DioException catch (e) {
AppLogger.error('Voice Assistant Error', e);
String errorMsg = 'حدث خطأ أثناء التواصل مع خادم الذكاء الاصطناعي';
if (e.response != null && e.response?.data != null) {
if (e.response?.data is Map && e.response?.data['message'] != null) {
errorMsg = e.response?.data['message'];
}
}
AppSnackbar.showError('خطأ', errorMsg);
} catch (e) {
AppLogger.error('Voice Assistant Error', e);
AppSnackbar.showError(
'خطأ', 'حدث خطأ أثناء التواصل مع خادم الذكاء الاصطناعي');
AppSnackbar.showError('خطأ', 'حدث خطأ غير متوقع');
}
}