Initial commit for intaleq_admin
This commit is contained in:
@@ -21,41 +21,47 @@ class DashboardController extends GetxController {
|
||||
isLoading = true;
|
||||
update();
|
||||
|
||||
// الطلب من السيرفر الرئيسي
|
||||
// 🔹 Request main dashboard data
|
||||
var res = await CRUD().get(link: AppLink.getdashbord, payload: {});
|
||||
print('📡 Main dashboard response: $res');
|
||||
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res);
|
||||
// Log.print('d: ${d}');
|
||||
dashbord = d['message']; // هذا عبارة عن List<Map>
|
||||
print('✅ Decoded main dashboard: ${jsonEncode(d)}');
|
||||
dashbord = d['message'];
|
||||
} else {
|
||||
print('❌ Failed to load main dashboard');
|
||||
}
|
||||
|
||||
// الطلب من سيرفر المحافظ
|
||||
// 🔹 Request wallet dashboard data
|
||||
var resPayments = await CRUD().postWallet(
|
||||
link: AppLink.getPaymentsDashboard,
|
||||
payload: {},
|
||||
);
|
||||
print('💳 Wallet dashboard response: $resPayments');
|
||||
|
||||
if (resPayments != 'failure') {
|
||||
var p = resPayments;
|
||||
// Log.print('p: ${p}');
|
||||
print('✅ Decoded wallet dashboard: ${jsonEncode(p)}');
|
||||
|
||||
// نتأكد أن الكل Map بداخل List
|
||||
if (dashbord.isNotEmpty &&
|
||||
p['message'] is List &&
|
||||
p['message'].isNotEmpty) {
|
||||
dashbord[0].addAll(p['message'][0]); // ندمج المعلومات داخل نفس الـ Map
|
||||
dashbord[0].addAll(p['message'][0]);
|
||||
}
|
||||
} else {
|
||||
print('❌ Failed to load wallet dashboard');
|
||||
}
|
||||
|
||||
// كريدت الرسائل
|
||||
// 🔹 Check SMS credit
|
||||
var res2 = await CRUD().kazumiSMS(
|
||||
link: 'https://sms.kazumi.me/api/sms/check-credit',
|
||||
payload: {"username": "Sefer", "password": AK.smsPasswordEgypt},
|
||||
);
|
||||
|
||||
creditSMS = res2['credit'];
|
||||
Log.print(' res2[credit]: ${res2['credit']}');
|
||||
Log.print('creditSMS: ${creditSMS}');
|
||||
print('📱 SMS Credit Response: ${jsonEncode(res2)}');
|
||||
print('💰 creditSMS: $creditSMS');
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
@@ -70,7 +76,7 @@ class DashboardController extends GetxController {
|
||||
// box.read(BoxName.tokensDrivers)['message'][i]['phone'].toString(),
|
||||
smsText.text,
|
||||
);
|
||||
// Log.print('CRUD().phoneDriversTest.: ${phoneNumber['phone']}');
|
||||
// print('CRUD().phoneDriversTest.: ${phoneNumber['phone']}');
|
||||
Future.delayed(const Duration(microseconds: 20));
|
||||
}
|
||||
Get.back();
|
||||
|
||||
Reference in New Issue
Block a user