المجلدات وأسماء حزم dart واستيراداتها: siro_rider → intaleq_rider siro_driver → intaleq_driver siro_admin → intaleq_admin siro_service → intaleq_service شمل ذلك `name:` في كل pubspec وكل `package:siro_*` في الاستيرادات (115 ملفاً في rider وحده)، وإشارات أسماء المجلدات في docs/ وتعليق في backend/Admin/notifications/broadcast.php. لم تبقَ إشارة واحدة (تحقّقت). + ضُمّت حزم get و get_storage داخل intaleq_driver/packages/ وحُوّلت مساراتها الثلاثة من `../../Intaleq/packages/*` إلى `./packages/*`. كانت تُحل عرضاً إلى مجلد App/Intaleq القديم المجاور — تبعية خارج المستودع تنكسر بأول نقل. لم يبقَ في أي تطبيق تبعية مسار خارج الشجرة. ⚠️ لم تُمسّ بعد: هويات المتاجر (applicationId · PRODUCT_BUNDLE_IDENTIFIER · shorebird app_id) ولا الألوان ولا النصوص المرئية ولا النطاقات — كل منها كوميت منفصل، والهويات تحتاج قرار المالك. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
92 lines
2.4 KiB
Dart
Executable File
92 lines
2.4 KiB
Dart
Executable File
import 'dart:convert';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:intaleq_driver/constant/style.dart';
|
|
import 'package:intaleq_driver/views/widgets/elevated_btn.dart';
|
|
import 'package:intaleq_driver/views/widgets/mydialoug.dart';
|
|
|
|
import '../../constant/box_name.dart';
|
|
import '../../constant/links.dart';
|
|
import '../../main.dart';
|
|
import '../functions/crud.dart';
|
|
|
|
class NotificationCaptainController extends GetxController {
|
|
bool isLoading = false;
|
|
Map notificationData = {};
|
|
|
|
getNotifications() async {
|
|
isLoading = true;
|
|
update();
|
|
var res = await CRUD().get(
|
|
link: AppLink.getNotificationCaptain,
|
|
payload: {'driverID': box.read(BoxName.driverID)});
|
|
if (res == "failure") {
|
|
// MyDialog().getDialog('There is no notification yet'.tr, '', () {
|
|
// Get.back();
|
|
// Get.back();
|
|
// });
|
|
Get.dialog(
|
|
CupertinoAlertDialog(
|
|
title: Column(
|
|
children: [
|
|
const Icon(
|
|
CupertinoIcons.bell_slash_fill,
|
|
color: CupertinoColors.systemGrey,
|
|
size: 40,
|
|
),
|
|
const SizedBox(height: 12),
|
|
Text(
|
|
'There is no notification yet'.tr,
|
|
style: const TextStyle(
|
|
fontSize: 17,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
actions: [
|
|
CupertinoDialogAction(
|
|
onPressed: () {
|
|
Get.back();
|
|
Get.back();
|
|
},
|
|
child: Text('Back'.tr),
|
|
),
|
|
],
|
|
),
|
|
barrierDismissible: true,
|
|
transitionCurve: Curves.easeOutBack,
|
|
transitionDuration: const Duration(milliseconds: 200),
|
|
);
|
|
}
|
|
notificationData = jsonDecode(res);
|
|
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
|
|
|
isLoading = false;
|
|
update();
|
|
}
|
|
|
|
updateNotification(String id) async {
|
|
await CRUD().post(
|
|
link: AppLink.updateNotificationCaptain,
|
|
payload: {'isShown': 'true', 'id': id},
|
|
);
|
|
}
|
|
|
|
addNotificationCaptain(String driverId, title, body, isPin) async {
|
|
await CRUD().post(link: AppLink.addNotificationCaptain, payload: {
|
|
'driverID': driverId,
|
|
'title': title,
|
|
'body': body,
|
|
'isPin': isPin
|
|
});
|
|
}
|
|
|
|
@override
|
|
void onInit() {
|
|
getNotifications();
|
|
super.onInit();
|
|
}
|
|
}
|