diff --git a/lib/controller/local/translations.dart b/lib/controller/local/translations.dart index b4d1561..23bccc2 100644 --- a/lib/controller/local/translations.dart +++ b/lib/controller/local/translations.dart @@ -458,12 +458,17 @@ class MyTranslation extends Translations { 'Are you sure to cancel?': "هل أنت متأكد من الإلغاء؟", 'Yes': 'نعم', 'Insert Emergincy Number': "أدخل رقم الطوارئ", - 'Best choice for comfort car and flexible route and stops point': 'أفضل اختيار لسيارة مريحة ومسار مرن ونقاط توقف', - 'Insert': "إدراج",'This is for delivery or a motorcycle.':"هذا للتسليم أو الدراجة النارية", - 'This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route':'الرحلة دي من نقطة البداية لنقطة النهاية بسعر ثابت والسواق لازم يمشي بنفس الطريق.', + 'Best choice for comfort car and flexible route and stops point': + 'أفضل اختيار لسيارة مريحة ومسار مرن ونقاط توقف', + 'Insert': "إدراج", + 'This is for delivery or a motorcycle.': + "هذا للتسليم أو الدراجة النارية", + 'This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route': + 'الرحلة دي من نقطة البداية لنقطة النهاية بسعر ثابت والسواق لازم يمشي بنفس الطريق.', 'You can decline a request without any cost': '‏يمكنك إلغاء الطلب بدون أي تكلفة', - 'Perfect for adventure seekers who want to experience something new and exciting':'خيار مثالي لللي عايزين يخرجوا من الروتين ويجربوا حاجات جديدة ومثيرة', + 'Perfect for adventure seekers who want to experience something new and exciting': + 'خيار مثالي لللي عايزين يخرجوا من الروتين ويجربوا حاجات جديدة ومثيرة', " My current location is:": "موقعي الحالي هو:", " \nand I have a trip on": "\nولدي رحلة على", "App \nwith Passenger ": "التطبيق\nمع الراكب ", @@ -625,7 +630,9 @@ class MyTranslation extends Translations { 'Counts of Hours on days': "عدد ساعات الأيام", 'OrderId': 'رقم الرحله', 'created time': "وقت الرحله", - 'Map Passenger': 'خارطه الراكب', + 'Speed Over': 'سرعة عالية', + 'I will slow down': 'حاضر هخفف', + 'Map Passenger': 'خارطه الراكب',"Be Slowly": "خفف شوية من السرعة", "If you want to make Google Map App run directly when you apply order": "إذا كنت تريد أن تفتح تطبيق خرائط جوجل مباشرة عند طلب الخدمة", "You can change the language of the app": "يمكنك تغيير لغة التطبيق", diff --git a/lib/views/home/Captin/mapDriverWidgets/driver_end_ride_bar.dart b/lib/views/home/Captin/mapDriverWidgets/driver_end_ride_bar.dart index 1ed12fe..3f72f0e 100644 --- a/lib/views/home/Captin/mapDriverWidgets/driver_end_ride_bar.dart +++ b/lib/views/home/Captin/mapDriverWidgets/driver_end_ride_bar.dart @@ -1,6 +1,10 @@ +import 'dart:io'; + import 'package:SEFER/controller/functions/location_controller.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:get/get.dart'; +import 'package:vibration/vibration.dart'; import '../../../../constant/colors.dart'; import '../../../../constant/style.dart'; @@ -18,7 +22,7 @@ GetBuilder driverEndRideBar() { decoration: AppStyle.boxDecoration, height: mapDriverController.remainingTimeTimerRideBegin < 60 ? mapDriverController.driverEndPage = 160 - : 120, + : 130, width: 240, child: Column( children: [ @@ -57,12 +61,14 @@ GetBuilder driverEndRideBar() { Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Text( - 'Timer is ${mapDriverController.rideTimerFromBegin.toStringAsFixed(0)}'), - Text( - 'Distance is ${mapDriverController.recentDistanceToDash.toStringAsFixed(0)}'), - Text( - 'Price is ${mapDriverController.price.toStringAsFixed(0)}') + const Icon(Icons.timer), + Text(mapDriverController.rideTimerFromBegin + .toStringAsFixed(0)), + const Icon(Icons.location_on), + Text(mapDriverController.recentDistanceToDash + .toStringAsFixed(0)), + const Icon(Icons.attach_money), + Text(mapDriverController.price.toStringAsFixed(0)), ], ), mapDriverController.carType == 'Free Ride' @@ -103,7 +109,7 @@ GetBuilder driverEndRideBar() { 60 ? AppColor.redColor : AppColor.greenColor, - minHeight: 40, + minHeight: 25, borderRadius: BorderRadius.circular(15), value: mapDriverController.progressTimerRideBegin .toDouble(), @@ -124,16 +130,37 @@ GetBuilder driverEndRideBar() { GetBuilder speedCircle() { return GetBuilder( - builder: (mapDriverController) => mapDriverController.isRideStarted + builder: (mapDriverController) { + if (mapDriverController.speed > 100) { + if (Platform.isIOS) { + HapticFeedback.selectionClick(); + } else { + Vibration.vibrate(duration: 1000); + } + Get.defaultDialog( + barrierDismissible: false, + titleStyle: AppStyle.title, + title: 'Speed Over'.tr, + middleText: 'Please slow down'.tr, + middleTextStyle: AppStyle.title, + confirm: MyElevatedButton( + title: 'I will slow down'.tr, + onPressed: () => Get.back(), + ), + ); + } + return mapDriverController.isRideStarted ? Positioned( - // left: 5, bottom: 25, right: 100, child: Container( decoration: BoxDecoration( - shape: BoxShape.circle, - color: AppColor.secondaryColor, - border: Border.all(width: 3, color: AppColor.redColor)), + shape: BoxShape.circle, + color: mapDriverController.speed > 100 + ? Colors.red + : AppColor.secondaryColor, + border: Border.all(width: 3, color: AppColor.redColor), + ), height: 60, width: 60, child: Center( @@ -142,6 +169,9 @@ GetBuilder speedCircle() { style: AppStyle.number, ), ), - )) - : const SizedBox()); + ), + ) + : const SizedBox(); + }, + ); }