From 8661bd7f3f4d0144d2d36f508180a4a2f857e97b Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Fri, 12 Jul 2024 22:52:54 +0300 Subject: [PATCH] 7/12/1 --- .../home/map_passenger_controller.dart | 6 +- lib/controller/local/translations.dart | 1 + .../google_map_passenger_widget.dart | 287 ++++++++++++------ .../map_widget.dart/left_main_menu_icons.dart | 36 +-- 4 files changed, 209 insertions(+), 121 deletions(-) diff --git a/lib/controller/home/map_passenger_controller.dart b/lib/controller/home/map_passenger_controller.dart index 505b2d5..6312202 100644 --- a/lib/controller/home/map_passenger_controller.dart +++ b/lib/controller/home/map_passenger_controller.dart @@ -1367,7 +1367,7 @@ class MapPassengerController extends GetxController { rotation: double.parse(json['heading']), icon: json['model'].toString().contains('دراجة') ? motoIcon - : json['gender'] == 'Male' + : json['gender'] == 'Male'.tr ? carIcon : ladyIcon, ), @@ -1385,7 +1385,7 @@ class MapPassengerController extends GetxController { rotation: double.parse(json['heading']), icon: json['model'].contains('دراجة') ? motoIcon - : json['gender'] == 'Male' + : json['gender'] == 'Male'.tr ? carIcon : ladyIcon, ); @@ -1588,7 +1588,7 @@ class MapPassengerController extends GetxController { ? motoIcon : datadriverCarsLocationToPassengerAfterApplied['message'][0] ['gender'] == - 'Male' + 'Male'.tr ? carIcon : ladyIcon, // Default to carIcon if gender is not Male or Female ); diff --git a/lib/controller/local/translations.dart b/lib/controller/local/translations.dart index 2e09b19..b31a005 100644 --- a/lib/controller/local/translations.dart +++ b/lib/controller/local/translations.dart @@ -267,6 +267,7 @@ iOS [https://getapp.cc/app/6458734951] "By selecting 'I Agree' below, I have reviewed and agree to the Terms of Use and acknowledge the Privacy Notice. I am at least 18 years of age.": "من خلال اختيار 'أوافق' أدناه، قمت بمراجعة وقبول شروط الاستخدام وأقر بإشعار الخصوصية. أنا على الأقل 18 عامًا.", "I Agree": "أوافق", + "Finish Monitor": " إنهاء مراقبة الرحلة ", "First name": "الاسم الأول", "Enter your first name": "أدخل اسمك الأول", "Please enter your first name.": "يرجى إدخال اسمك الأول.", diff --git a/lib/views/home/map_widget.dart/google_map_passenger_widget.dart b/lib/views/home/map_widget.dart/google_map_passenger_widget.dart index 37a4945..3b439b9 100644 --- a/lib/views/home/map_widget.dart/google_map_passenger_widget.dart +++ b/lib/views/home/map_widget.dart/google_map_passenger_widget.dart @@ -1,3 +1,4 @@ +import 'package:SEFER/views/widgets/my_dialog.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; @@ -29,108 +30,194 @@ class GoogleMapPassengerWidget extends StatelessWidget { cameraTargetBounds: CameraTargetBounds(controller.boundsdata), minMaxZoomPreference: const MinMaxZoomPreference(6, 18), onLongPress: (argument) { - Get.defaultDialog( - title: 'Are you want to go to this site'.tr, - content: Column( - children: [ - Text('${argument.latitude},${argument.longitude}'), - ], - ), - confirm: MyElevatedButton( - title: 'Ok'.tr, - onPressed: () async { - controller.clearPolyline(); - if (controller.dataCarsLocationByPassenger != null) { - await controller.getMap( - '${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}', - '${argument.latitude.toString()},${argument.longitude.toString()}'); + MyDialog().getDialog('Are you want to go to this site'.tr, '', + () async { + controller.clearPolyline(); + if (controller.dataCarsLocationByPassenger != null) { + await controller.getMap( + '${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}', + '${argument.latitude.toString()},${argument.longitude.toString()}'); - Get.back(); - controller.bottomSheet(); - controller.showBottomSheet1(); - } else { - Get.back(); - Get.snackbar( - 'We Are Sorry That we dont have cars in your Location!' - .tr, - '', - colorText: AppColor.redColor, - duration: const Duration(seconds: 11), - instantInit: true, - snackPosition: SnackPosition.TOP, - titleText: Text( - 'Error'.tr, - style: - const TextStyle(color: AppColor.redColor), - ), - messageText: Text( - 'We Are Sorry That we dont have cars in your Location!' - .tr, - style: AppStyle.title, - ), - icon: const Icon(Icons.error), - shouldIconPulse: true, - maxWidth: double.infinity, - margin: const EdgeInsets.all(16), - padding: const EdgeInsets.all(16), - borderRadius: 8, - borderColor: AppColor.redColor, - borderWidth: 2, - backgroundColor: AppColor.secondaryColor, - leftBarIndicatorColor: AppColor.redColor, - boxShadows: [ - BoxShadow( - color: Colors.black.withOpacity(0.25), - blurRadius: 4, - spreadRadius: 2, - offset: const Offset(0, 4), - ), - ], - backgroundGradient: const LinearGradient( - colors: [ - AppColor.redColor, - AppColor.accentColor - ], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - // mainButton: TextButton( - // onPressed: () { - // controller.getCarsLocationByPassenger(); - // }, - // child: Text( - // 'Try Again'.tr, - // style: const TextStyle( - // color: AppColor.secondaryColor), - // ), - // ), - onTap: (GetSnackBar snackBar) { - // Do something when the snackbar is tapped. - }, - isDismissible: true, - showProgressIndicator: false, - dismissDirection: DismissDirection.up, - progressIndicatorController: null, - progressIndicatorBackgroundColor: - Colors.transparent, - progressIndicatorValueColor: null, - snackStyle: SnackStyle.GROUNDED, - forwardAnimationCurve: Curves.easeInToLinear, - reverseAnimationCurve: Curves.easeInOut, - animationDuration: - const Duration(milliseconds: 4000), - barBlur: 8, - overlayBlur: 0, - snackbarStatus: null, - overlayColor: - AppColor.primaryColor.withOpacity(0.5), - userInputForm: null, - ); - } + Get.back(); + controller.bottomSheet(); + controller.showBottomSheet1(); + } else { + Get.back(); + Get.snackbar( + 'We Are Sorry That we dont have cars in your Location!' + .tr, + '', + colorText: AppColor.redColor, + duration: const Duration(seconds: 11), + instantInit: true, + snackPosition: SnackPosition.TOP, + titleText: Text( + 'Error'.tr, + style: const TextStyle(color: AppColor.redColor), + ), + messageText: Text( + 'We Are Sorry That we dont have cars in your Location!' + .tr, + style: AppStyle.title, + ), + icon: const Icon(Icons.error), + shouldIconPulse: true, + maxWidth: double.infinity, + margin: const EdgeInsets.all(16), + padding: const EdgeInsets.all(16), + borderRadius: 8, + borderColor: AppColor.redColor, + borderWidth: 2, + backgroundColor: AppColor.secondaryColor, + leftBarIndicatorColor: AppColor.redColor, + boxShadows: [ + BoxShadow( + color: Colors.black.withOpacity(0.25), + blurRadius: 4, + spreadRadius: 2, + offset: const Offset(0, 4), + ), + ], + backgroundGradient: const LinearGradient( + colors: [AppColor.redColor, AppColor.accentColor], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + // mainButton: TextButton( + // onPressed: () { + // controller.getCarsLocationByPassenger(); + // }, + // child: Text( + // 'Try Again'.tr, + // style: const TextStyle( + // color: AppColor.secondaryColor), + // ), + // ), + onTap: (GetSnackBar snackBar) { + // Do something when the snackbar is tapped. + }, + isDismissible: true, + showProgressIndicator: false, + dismissDirection: DismissDirection.up, + progressIndicatorController: null, + progressIndicatorBackgroundColor: Colors.transparent, + progressIndicatorValueColor: null, + snackStyle: SnackStyle.GROUNDED, + forwardAnimationCurve: Curves.easeInToLinear, + reverseAnimationCurve: Curves.easeInOut, + animationDuration: const Duration(milliseconds: 4000), + barBlur: 8, + overlayBlur: 0, + snackbarStatus: null, + overlayColor: AppColor.primaryColor.withOpacity(0.5), + userInputForm: null, + ); + } - // - }), - ); + // + }); + // Get.defaultDialog( + // title: 'Are you want to go to this site'.tr, + // content: Column( + // children: [ + // Text('${argument.latitude},${argument.longitude}'), + // ], + // ), + // confirm: MyElevatedButton( + // title: 'Ok'.tr, + // onPressed: () async { + // controller.clearPolyline(); + // if (controller.dataCarsLocationByPassenger != null) { + // await controller.getMap( + // '${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}', + // '${argument.latitude.toString()},${argument.longitude.toString()}'); + + // Get.back(); + // controller.bottomSheet(); + // controller.showBottomSheet1(); + // } else { + // Get.back(); + // Get.snackbar( + // 'We Are Sorry That we dont have cars in your Location!' + // .tr, + // '', + // colorText: AppColor.redColor, + // duration: const Duration(seconds: 11), + // instantInit: true, + // snackPosition: SnackPosition.TOP, + // titleText: Text( + // 'Error'.tr, + // style: + // const TextStyle(color: AppColor.redColor), + // ), + // messageText: Text( + // 'We Are Sorry That we dont have cars in your Location!' + // .tr, + // style: AppStyle.title, + // ), + // icon: const Icon(Icons.error), + // shouldIconPulse: true, + // maxWidth: double.infinity, + // margin: const EdgeInsets.all(16), + // padding: const EdgeInsets.all(16), + // borderRadius: 8, + // borderColor: AppColor.redColor, + // borderWidth: 2, + // backgroundColor: AppColor.secondaryColor, + // leftBarIndicatorColor: AppColor.redColor, + // boxShadows: [ + // BoxShadow( + // color: Colors.black.withOpacity(0.25), + // blurRadius: 4, + // spreadRadius: 2, + // offset: const Offset(0, 4), + // ), + // ], + // backgroundGradient: const LinearGradient( + // colors: [ + // AppColor.redColor, + // AppColor.accentColor + // ], + // begin: Alignment.topLeft, + // end: Alignment.bottomRight, + // ), + // // mainButton: TextButton( + // // onPressed: () { + // // controller.getCarsLocationByPassenger(); + // // }, + // // child: Text( + // // 'Try Again'.tr, + // // style: const TextStyle( + // // color: AppColor.secondaryColor), + // // ), + // // ), + // onTap: (GetSnackBar snackBar) { + // // Do something when the snackbar is tapped. + // }, + // isDismissible: true, + // showProgressIndicator: false, + // dismissDirection: DismissDirection.up, + // progressIndicatorController: null, + // progressIndicatorBackgroundColor: + // Colors.transparent, + // progressIndicatorValueColor: null, + // snackStyle: SnackStyle.GROUNDED, + // forwardAnimationCurve: Curves.easeInToLinear, + // reverseAnimationCurve: Curves.easeInOut, + // animationDuration: + // const Duration(milliseconds: 4000), + // barBlur: 8, + // overlayBlur: 0, + // snackbarStatus: null, + // overlayColor: + // AppColor.primaryColor.withOpacity(0.5), + // userInputForm: null, + // ); + // } + + // // + // }), + // ); }, onTap: (argument) { diff --git a/lib/views/home/map_widget.dart/left_main_menu_icons.dart b/lib/views/home/map_widget.dart/left_main_menu_icons.dart index 3c479e0..4d8d8c2 100644 --- a/lib/views/home/map_widget.dart/left_main_menu_icons.dart +++ b/lib/views/home/map_widget.dart/left_main_menu_icons.dart @@ -85,24 +85,24 @@ GetBuilder leftMainMenuIcons() { const SizedBox( width: 5, ), - AnimatedContainer( - duration: const Duration(microseconds: 200), - width: controller.widthMapTypeAndTraffic, - decoration: BoxDecoration( - color: AppColor.secondaryColor, - border: Border.all(), - borderRadius: BorderRadius.circular(15)), - child: IconButton( - onPressed: () async { - box.remove(BoxName.isVerified); - Get.to(() => SmsSignupEgypt()); - }, - icon: const Icon( - Icons.voice_chat, - size: 29, - ), - ), - ), + // AnimatedContainer( + // duration: const Duration(microseconds: 200), + // width: controller.widthMapTypeAndTraffic, + // decoration: BoxDecoration( + // color: AppColor.secondaryColor, + // border: Border.all(), + // borderRadius: BorderRadius.circular(15)), + // child: IconButton( + // onPressed: () async { + // box.remove(BoxName.isVerified); + // Get.to(() => SmsSignupEgypt()); + // }, + // icon: const Icon( + // Icons.voice_chat, + // size: 29, + // ), + // ), + // ), // AnimatedContainer( // duration: const Duration(microseconds: 200), // width: controller.widthMapTypeAndTraffic,