Update: 2026-08-08 17:35:50
This commit is contained in:
@@ -5,11 +5,8 @@ import 'package:get/get.dart';
|
||||
|
||||
import '../../../../constant/box_name.dart';
|
||||
import '../../../../constant/links.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../main.dart';
|
||||
import '../../../../views/widgets/elevated_btn.dart';
|
||||
import '../../../functions/crud.dart';
|
||||
import '../../../functions/encrypt_decrypt.dart';
|
||||
|
||||
class HelpController extends GetxController {
|
||||
bool isLoading = false;
|
||||
@@ -20,6 +17,9 @@ class HelpController extends GetxController {
|
||||
String status = '';
|
||||
String qustion = '';
|
||||
late int indexQuestion = 0;
|
||||
|
||||
Map<int, String> aiReplies = {};
|
||||
|
||||
getIndex(int i, String qustion1) async {
|
||||
indexQuestion = i;
|
||||
qustion = qustion1;
|
||||
@@ -38,13 +38,15 @@ class HelpController extends GetxController {
|
||||
update();
|
||||
if (d['status'].toString() == 'success') {
|
||||
getHelpQuestion();
|
||||
// Get.snackbar('Feedback data saved successfully'.tr, '',
|
||||
// backgroundColor: AppColor.greenColor,
|
||||
// snackPosition: SnackPosition.BOTTOM);
|
||||
helpQuestionController.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void getHelpQuestion() async {
|
||||
getHelpQuestionFuture();
|
||||
}
|
||||
|
||||
Future<void> getHelpQuestionFuture() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.gethelpCenter, payload: {
|
||||
@@ -52,27 +54,9 @@ class HelpController extends GetxController {
|
||||
});
|
||||
if (res == "failure") {
|
||||
isLoading = false;
|
||||
helpQuestionDate = {'message': []};
|
||||
update();
|
||||
Get.defaultDialog(
|
||||
title: 'There is no help Question here'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
middleText: '',
|
||||
confirm: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'Add Question'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}),
|
||||
MyElevatedButton(
|
||||
title: 'Back'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
Get.back();
|
||||
}),
|
||||
],
|
||||
));
|
||||
return;
|
||||
}
|
||||
helpQuestionDate = jsonDecode(res);
|
||||
isLoading = false;
|
||||
@@ -89,14 +73,20 @@ class HelpController extends GetxController {
|
||||
status = 'not yet';
|
||||
isLoading = false;
|
||||
update();
|
||||
} else {
|
||||
status = 'done';
|
||||
helpQuestionRepleyDate = jsonDecode(res);
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
helpQuestionRepleyDate = jsonDecode(res);
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
final storedReplies = box.read<Map<String, dynamic>>('ai_replies') ?? {};
|
||||
aiReplies = storedReplies
|
||||
.map((key, value) => MapEntry(int.parse(key), value.toString()));
|
||||
|
||||
getHelpQuestion();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@@ -2717,4 +2717,52 @@ final Map<String, String> ar_jo = {
|
||||
"My Earnings": "أرباحي",
|
||||
"Upcoming Scheduled Rides": "الرحلات المجدولة القادمة",
|
||||
"Retry": "إعادة المحاولة",
|
||||
// Insurance
|
||||
"Cancelling stops future premiums. Outstanding dues remain payable.": "يؤدي الإلغاء إلى إيقاف الأقساط المستقبلية. تبقى المستحقات السابقة واجبة الدفع.",
|
||||
"Insurance plans have not been launched in your area yet. Once a partner plan is available it will appear here automatically.": "لم يتم إطلاق خطط التأمين في منطقتك بعد. بمجرد توفر خطة الشريك، ستظهر هنا تلقائياً.",
|
||||
"No insurance plans available yet": "لا توجد خطط تأمين متاحة بعد",
|
||||
"Outstanding": "المستحق",
|
||||
"Settled": "المدفوع",
|
||||
"Cancel policy": "إلغاء الوثيقة",
|
||||
"Subscribe": "اشتراك",
|
||||
"Not eligible yet": "غير مؤهل بعد",
|
||||
"Premium ledger": "سجل الأقساط",
|
||||
"Insurance": "التأمين",
|
||||
"Premium": "القسط",
|
||||
"Started on": "بدأ في",
|
||||
"Policy number": "رقم الوثيقة",
|
||||
"rides": "رحلة",
|
||||
"Refresh": "تحديث",
|
||||
|
||||
// Scheduled rides
|
||||
"Could not load scheduled rides": "تعذر تحميل الرحلات المجدولة",
|
||||
"Please check your connection and try again.": "يرجى التحقق من اتصالك والمحاولة مرة أخرى.",
|
||||
"You have no upcoming scheduled rides": "ليس لديك أي رحلات مجدولة قادمة",
|
||||
"Starting Point": "نقطة الانطلاق",
|
||||
"Destination": "الوجهة",
|
||||
"Currency": "دينار أردني",
|
||||
|
||||
// Invites
|
||||
"Invite": "دعوة",
|
||||
"Drivers": "سائقون",
|
||||
"Passengers": "ركاب",
|
||||
"Your Permanent Referral Code": "رمز الدعوة الدائم الخاص بك",
|
||||
"Share via WhatsApp Groups": "شارك عبر مجموعات الواتساب",
|
||||
"Enter Inviter's Code": "أدخل رمز الداعي",
|
||||
"If someone referred you, enter their code below to link accounts and receive rewards.": "إذا قام شخص ما بدعوتك، أدخل رمزه أدناه لربط الحسابات والحصول على المكافآت.",
|
||||
"Enter Code (e.g. AB1234)": "أدخل الرمز (مثال: AB1234)",
|
||||
"Link": "ربط",
|
||||
"Please enter a referral code": "يرجى إدخال رمز الدعوة",
|
||||
"Enter phone": "أدخل رقم الهاتف",
|
||||
"Send Invite": "إرسال دعوة",
|
||||
"Show Invitations": "عرض الدعوات",
|
||||
"Invitations Sent": "الدعوات المرسلة",
|
||||
"No invitation found yet!": "لم يتم العثور على أي دعوات بعد!",
|
||||
"Trip": "رحلة",
|
||||
"Choose from contact": "اختر من جهات الاتصال",
|
||||
"Invite another driver and both get a gift after he completes 100 trips!": "ادعُ سائقًا آخر واحصل كليكما على هدية بعد إكماله 100 رحلة!",
|
||||
"Share this code with passengers and earn rewards when they use it!": "شارك هذا الرمز مع الركاب واكسب مكافآت عند استخدامه!",
|
||||
|
||||
// Help Center
|
||||
"No questions asked yet.": "لم يتم طرح أي أسئلة بعد.",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user