7/12/1
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user