fix: resolve stale price display in driver ratings and remove misleading discount UI in rider ratings
This commit is contained in:
@@ -76,9 +76,14 @@ class RatePassenger extends StatelessWidget {
|
||||
Widget _buildHeroPriceDisplay(BuildContext context) {
|
||||
final MapDriverController mapController = Get.find<MapDriverController>();
|
||||
|
||||
// Parse the string to double to format it correctly
|
||||
double amount =
|
||||
double.tryParse(mapController.paymentAmount.toString()) ?? 0.0;
|
||||
// 🔥 [Fix Stale Price] كان يُعرض mapController.paymentAmount — وهو السعر
|
||||
// المُقتبَس وقت عرض الرحلة على السائق، ولا يتحدث أبداً بعد ذلك. السعر
|
||||
// النهائي الصحيح (بعد كل التعديلات من finish_ride_updates.php) موجود
|
||||
// فعلاً في controller.price لكنه لم يكن يُستخدم هنا. الآن نعتمده أولاً.
|
||||
final String? finalPriceStr = controller.price;
|
||||
double amount = (finalPriceStr != null && finalPriceStr.isNotEmpty)
|
||||
? (double.tryParse(finalPriceStr) ?? 0.0)
|
||||
: (double.tryParse(mapController.paymentAmount.toString()) ?? 0.0);
|
||||
String formattedAmount = currencyFormatter.format(amount);
|
||||
|
||||
return Container(
|
||||
|
||||
Reference in New Issue
Block a user