refactor: إعادة تسمية التطبيقات الأربعة siro_* → intaleq_*
المجلدات وأسماء حزم 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>
This commit is contained in:
co-authored by
Claude Opus 5
parent
92dc6b3641
commit
0aab85c732
@@ -0,0 +1,87 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intaleq_rider/constant/box_name.dart';
|
||||
import 'package:intaleq_rider/constant/links.dart';
|
||||
import 'package:intaleq_rider/constant/style.dart';
|
||||
import 'package:intaleq_rider/controller/functions/crud.dart';
|
||||
import 'package:intaleq_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
import 'package:intaleq_rider/main.dart';
|
||||
import 'package:intaleq_rider/views/home/map_page_passenger.dart';
|
||||
import 'package:intaleq_rider/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../firebase/notification_service.dart';
|
||||
import '../payment/payment_controller.dart';
|
||||
|
||||
// import '../home/captin/home_captain_controller.dart';
|
||||
|
||||
class RateController extends GetxController {
|
||||
double selectedRateItemId = -1;
|
||||
TextEditingController comment = TextEditingController();
|
||||
String? rideId, passengerId, driverId, driverName, price;
|
||||
late GlobalKey<FormState> formKey;
|
||||
@override
|
||||
void onInit() {
|
||||
formKey = GlobalKey<FormState>();
|
||||
passengerId = Get.arguments['passengerId'];
|
||||
rideId = Get.arguments['rideId'];
|
||||
driverId = Get.arguments['driverId'];
|
||||
driverName = Get.arguments['driverName'];
|
||||
price = Get.arguments['price'];
|
||||
box.write(BoxName.tipPercentage, '0');
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
void selectRateItem(double id) {
|
||||
selectedRateItemId = id;
|
||||
update();
|
||||
}
|
||||
|
||||
addRateToDriver() async {
|
||||
if (selectedRateItemId < 1) {
|
||||
Get.defaultDialog(
|
||||
title: 'You Should choose rate figure'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
middleText: '',
|
||||
confirm: MyElevatedButton(title: 'Ok', onPressed: () => Get.back()));
|
||||
} else if (Get.find<PaymentController>().isWalletChecked == true) {
|
||||
double tip = 0;
|
||||
tip = double.parse(Get.find<RideLifecycleController>().totalPassenger.toString()) *
|
||||
(double.parse(box.read(BoxName.tipPercentage).toString()));
|
||||
|
||||
if (tip > 0) {
|
||||
var res = await CRUD().post(link: AppLink.addTips, payload: {
|
||||
'passengerID': box.read(BoxName.passengerID).toString(),
|
||||
'driverID': Get.find<RideLifecycleController>().driverId.toString(),
|
||||
'rideID': Get.find<RideLifecycleController>().rideId.toString(),
|
||||
'tipAmount': tip.toString(),
|
||||
'country_code': box.read(BoxName.countryCode).toString(),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
await NotificationService.sendNotification(
|
||||
category: 'You Have Tips',
|
||||
target: Get.find<RideLifecycleController>().driverToken.toString(),
|
||||
title: 'You Have Tips'.tr,
|
||||
body:
|
||||
'${'${tip.toString()}\$${' tips\nTotal is'.tr}'} ${tip + double.parse(Get.find<RideLifecycleController>().totalPassenger.toString())}',
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'ding',
|
||||
driverList: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
await CRUD().post(
|
||||
link: "${AppLink.server}/ride/rate/addRateToDriver.php",
|
||||
payload: {
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'driver_id': driverId.toString(),
|
||||
'ride_id': rideId.toString(),
|
||||
'rating': selectedRateItemId.toString(),
|
||||
'comment': comment.text,
|
||||
},
|
||||
);
|
||||
|
||||
Get.find<RideLifecycleController>().restCounter();
|
||||
Get.offAll(const MapPagePassenger());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user