المجلدات وأسماء حزم 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>
88 lines
3.4 KiB
Dart
Executable File
88 lines
3.4 KiB
Dart
Executable File
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:intaleq_driver/controller/notification/notification_captain_controller.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
class NotificationCaptain extends StatelessWidget {
|
|
const NotificationCaptain({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Get.put(NotificationCaptainController());
|
|
|
|
return CupertinoPageScaffold(
|
|
navigationBar: CupertinoNavigationBar(
|
|
middle: Text('Notifications'.tr),
|
|
leading: CupertinoNavigationBarBackButton(
|
|
onPressed: () => Get.back(),
|
|
),
|
|
),
|
|
child: SafeArea(
|
|
child: GetBuilder<NotificationCaptainController>(
|
|
builder: (notificationCaptainController) =>
|
|
notificationCaptainController.isLoading
|
|
? const Center(child: CupertinoActivityIndicator())
|
|
: ListView.builder(
|
|
itemCount: notificationCaptainController
|
|
.notificationData['message'].length,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
if (notificationCaptainController
|
|
.notificationData['message'] ==
|
|
"No notification data found") {
|
|
_showCupertinoDialog(context, 'No Notifications',
|
|
'There are no notifications at this time.');
|
|
return const SizedBox.shrink();
|
|
}
|
|
var res = notificationCaptainController
|
|
.notificationData['message'][index];
|
|
return CupertinoListTile(
|
|
leading: const Icon(CupertinoIcons.bell_fill),
|
|
title: Text(
|
|
res['title'],
|
|
style:
|
|
CupertinoTheme.of(context).textTheme.textStyle,
|
|
),
|
|
subtitle: Text(
|
|
res['body'],
|
|
style: CupertinoTheme.of(context)
|
|
.textTheme
|
|
.tabLabelTextStyle,
|
|
),
|
|
onTap: () {
|
|
_showCupertinoDialog(
|
|
context,
|
|
res['title'],
|
|
res['body'],
|
|
onConfirm: () {
|
|
notificationCaptainController
|
|
.updateNotification(res['id'].toString());
|
|
Navigator.of(context).pop();
|
|
},
|
|
);
|
|
},
|
|
);
|
|
},
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
void _showCupertinoDialog(BuildContext context, String title, String content,
|
|
{VoidCallback? onConfirm}) {
|
|
showCupertinoDialog(
|
|
context: context,
|
|
builder: (BuildContext context) => CupertinoAlertDialog(
|
|
title: Text(title),
|
|
content: Text(content),
|
|
actions: <CupertinoDialogAction>[
|
|
CupertinoDialogAction(
|
|
child: const Text('OK'),
|
|
onPressed: onConfirm ?? () => Navigator.of(context).pop(),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|