fix(rider): البحث عن مكان والمحفظة الحقيقية وأسماء الخريطة

## البحث لم يكن يستجيب — غلافان مختلفان
مثبت بـcurl: /geocoding/search يرجّع {"results":[…]} بينما /geocoding/reverse
يرجّع مصفوفة عارية. افترضتُ كليهما مصفوفة، فكان البحث يفشل صامتاً — ولهذا
«تحديد من الخريطة» يعمل (يستعمل reverse) والبحث لا. أُضيفت رسالة «لا نتائج»
كي لا يبقى الفراغ غامضاً، وأيقونة لكل صنف مكان.

## المحفظة صارت دفعاً حقيقياً لا كاش-إن
كنت أستعمل POST /wallet/topup — وهو بوصف الخادم كاش-إن تجريبي يزيد الرصيد
بلا دفع. المسار الصحيح موجود أصلاً: POST /payments/charge مع provider
وpurpose، وسجلّ بوابات فيه cash · paymob · syriatel · mtn ومحوّل فاتورة
لـ cliq · shamcash · zaincash.

كليك وشام كاش وزين كاش تعمل بنمط **الفاتورة** — نفس ما يفعله سيرو حرفياً
(create_cliq_invoice.php): الخادم يولّد مرجعاً ويعرض حساب الاستلام، ويحوّل
المستخدم، والتسوية تصل لاحقاً بمطابقة رسالة المزوّد. لا بوابة تحويل حيّة.
- InvoiceSheet يعرض المرجع وحساب الاستلام بزرّي نسخ — الرقم يُحوَّل في تطبيق
  بنك آخر فالنسخ ليس رفاهية
- يُقال صراحةً أن الرصيد لا يزيد الآن، قبل الضغط لا بعده
- حساب استلام غير مضبوط للمستأجر يُعرض كخطأ لا كتعليمات ناقصة
- أسماء المزوّدين صُحّحت لتطابق PaymentGatewayRegistry حرفياً (syriatel لا
  syriatel_cash…) — أي اسم آخر يرجّع 400
- qi_card حُذف: لا محوّل له على الخادم
- السائق: chargeCredit بنيّة credit_topup للرصيد التشغيلي

## الخريطة وواجهة «إلى أين»
- أسماء البداية والنهاية تُرسم فوق الخريطة (نمط سيرو) كطبقة فلاتر لا marker
- البطاقة المطوية صارت حقل بحث بارزاً مع الموقع الحالي فوقه
- حقل البحث يفتح مركّزاً مع زرّ مسح

## أداة
tool/sync_from_rider.sh كان يستثني ملفَّي ARB فيُسقط كل مفتاح مشترك جديد
ويكسر بناء السائق — تكرّر ثلاث مرات. صارا يُنسخان ثم تُفرض نصوص السائق فوقهما.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Hamza-Ayed
2026-08-05 01:26:05 +03:00
co-authored by Claude Opus 5
parent e22cc5c7e4
commit 6a33cc7241
26 changed files with 965 additions and 121 deletions
@@ -72,6 +72,8 @@ class _RidePageState extends State<RidePage> with WidgetsBindingObserver {
driver: s.driverLocation,
route: s.route,
camera: s.cameraTarget,
originLabel: s.originLabel,
destinationLabel: s.destinationLabel,
),
builder: (context, data) => RideMap(
origin: data.origin,
@@ -83,6 +85,8 @@ class _RidePageState extends State<RidePage> with WidgetsBindingObserver {
// الورقة تغطّي نحو ثلث الشاشة — يُحسب منه إطار المسار كي لا
// يختفي نصفه تحتها.
bottomInset: MediaQuery.sizeOf(context).height * 0.34,
originLabel: data.originLabel,
destinationLabel: data.destinationLabel,
),
),
@@ -134,6 +138,8 @@ class _MapData {
this.driver,
this.route,
this.camera,
this.originLabel = '',
this.destinationLabel = '',
});
final GeoPoint? origin;
@@ -141,6 +147,8 @@ class _MapData {
final GeoPoint? driver;
final dynamic route;
final GeoPoint? camera;
final String originLabel;
final String destinationLabel;
@override
bool operator ==(Object other) =>
@@ -149,10 +157,20 @@ class _MapData {
other.destination == destination &&
other.driver == driver &&
other.route == route &&
other.camera == camera;
other.camera == camera &&
other.originLabel == originLabel &&
other.destinationLabel == destinationLabel;
@override
int get hashCode => Object.hash(origin, destination, driver, route, camera);
int get hashCode => Object.hash(
origin,
destination,
driver,
route,
camera,
originLabel,
destinationLabel,
);
}
class _Sheet extends StatelessWidget {
@@ -164,8 +182,10 @@ class _Sheet extends StatelessWidget {
@override
Widget build(BuildContext context) {
final child = switch (state.phase) {
RidePhase.idle =>
_Collapsed(noLocation: state.error == RideError.noLocation),
RidePhase.idle => _Collapsed(
noLocation: state.error == RideError.noLocation,
originLabel: state.originLabel,
),
RidePhase.planning => PlannerSheet(state: state),
RidePhase.pickingOnMap => _PickConfirm(onConfirm: onConfirmPick),
RidePhase.confirming => ConfirmSheet(state: state),
@@ -222,16 +242,22 @@ class _MapFab extends StatelessWidget {
}
}
/// البطاقة المطوية — واجهة «إلى أين؟».
///
/// حقل بحث حقيقي لا زرّ يفتح شاشة: الراكب يبدأ الكتابة فوراً. وموقعه الحالي
/// معروض فوقه كي يتأكّد أن نقطة البداية صحيحة قبل أن يفكّر في الوجهة.
class _Collapsed extends StatelessWidget {
const _Collapsed({required this.noLocation});
const _Collapsed({required this.noLocation, required this.originLabel});
final bool noLocation;
final String originLabel;
@override
Widget build(BuildContext context) {
final cubit = context.read<RideCubit>();
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// بلا موقع لا خريطة مفيدة — السبب يُعرض مع مخرجه بدل خريطة صامتة
// على موقع خاطئ.
@@ -247,11 +273,60 @@ class _Collapsed extends StatelessWidget {
),
const SizedBox(height: Space.sm),
],
TripzButton.secondary(
label: context.l10n.rideWhereTo,
icon: Icons.search_rounded,
expanded: true,
onPressed: cubit.openPlanner,
if (originLabel.isNotEmpty) ...[
Row(
children: [
Container(
width: 10,
height: 10,
decoration: BoxDecoration(
color: context.tripzColors.mapOrigin,
shape: BoxShape.circle,
),
),
const SizedBox(width: Space.xs),
Expanded(
child: Text(
originLabel,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: context.texts.bodySmall?.copyWith(
color: context.colors.onSurfaceVariant,
),
),
),
],
),
const SizedBox(height: Space.sm),
],
// حقل بحث لا زرّ: الضغط عليه يفتح المخطّط والكيبورد معاً.
Material(
color: context.colors.surfaceContainerHighest,
borderRadius: Radii.card_,
child: InkWell(
onTap: cubit.openPlanner,
borderRadius: Radii.card_,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: Space.md,
vertical: Space.sm,
),
child: Row(
children: [
Icon(Icons.search_rounded, color: context.colors.primary),
const SizedBox(width: Space.sm),
Expanded(
child: Text(
context.l10n.rideWhereTo,
style: context.texts.titleMedium?.copyWith(
color: context.colors.onSurfaceVariant,
),
),
),
],
),
),
),
),
],
);