feat: N1d/N2/N3 + قانون فلاتر وإعادة ضبط تطبيق السائق

الباك إند:
- تعيين أول أدمن صار يُنشئ المستخدم إن لم يوجد — كان يشترط دخولاً سابقاً،
  وهي بيضة ودجاجة تمنع الدخول إلى لوحة أي مستأجر جديد أصلاً.
- OTP_DEV_MODE كان يفشل مفتوحاً (`!== 'false'`): غياب المتغيّر أو خطأ مطبعي
  يترك الإنتاج برمز ثابت يفتح كل حساب، ويحرس السحب المالي كذلك. صار
  `=== 'true'` في الإعداد وفي قارئَيه، مع تحذير عند الإقلاع.
- N2: التحقّق من اللوغو عند الرفع (PNG/JPEG · 512+ · مربّع · سقف 5MB) عبر
  قراءة الترويسة بلا اعتمادية — بدل اكتشاف أيقونة ممطوطة بعد النشر.

N3: السكربت يولّد build_config.dart بأعلام const (طبقات docs/22 §1.5)،
ويضبط bundle IDs واسم التطبيق والأيقونات/splash، و--build يشغّل Shorebird.

فلاتر:
- docs/23: قانون مُلزِم للتطبيقين (البنية · Cubit · طبقة الشبكة · الأعلام).
- السائق: أُزيل Dart القديم (GetX) مع الإبقاء على الأصيل والإضافات وشهادات
  التوقيع وShorebird وFirebase الخاص به، وأُعيد هيكلته مطابقاً للراكب.
- طبقة الشبكة ترسل x-device-id وتجدّد التوكن عند 401 مرة واحدة فقط.
- الحزم موحّدة بين التطبيقين، والـAPI https حصراً في الاثنين.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hamza-Ayed
2026-07-18 13:06:46 +03:00
co-authored by Claude Fable 5
parent 3ab74a13a8
commit de4bbd00ac
271 changed files with 1333 additions and 81068 deletions
@@ -1,74 +0,0 @@
import 'dart:convert';
import 'package:get/get.dart';
import 'package:sefer_driver/controller/firebase/firbase_messge.dart';
import '../../constant/box_name.dart';
import '../../constant/links.dart';
import '../../constant/style.dart';
import '../../main.dart';
import '../../views/widgets/elevated_btn.dart';
import '../firebase/notification_service.dart';
import '../functions/crud.dart';
class PassengerNotificationController extends GetxController {
bool isloading = false;
Map notificationData = {};
getNotifications() async {
isloading = true;
update();
var res = await CRUD().get(
link: AppLink.getNotificationPassenger,
payload: {'passenger_id': box.read(BoxName.passengerID)});
if (res == "failure") {
Get.defaultDialog(
title: 'There is no notification yet'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Back',
onPressed: () {
Get.back();
Get.back();
}));
}
notificationData = jsonDecode(res);
// sql.insertData(notificationData['message'], TableName.captainNotification);
isloading = false;
update();
}
updateNotification(String id) async {
await CRUD().post(
link: AppLink.updateNotificationPassenger,
payload: {'isShown': 'true', 'id': id},
);
Get.back();
getNotifications();
}
addNotificationToPassenger(String title, body) async {
var res = CRUD().post(link: AppLink.addNotificationPassenger, payload: {
'title': title,
'body': body,
});
// FirebaseMessagesController()
// .sendNotificationToPassengerToken(title, body, 'token', [], 'ding.wav');
NotificationService.sendNotification(
target: 'token'.toString(),
title: title.tr,
body: body,
isTopic: false, // Important: this is a token
tone: 'ding',
driverList: [], category: title,
);
}
@override
void onInit() {
getNotifications();
super.onInit();
}
}