24-12/31/1

This commit is contained in:
Hamza-Ayed
2024-12-31 21:26:03 +03:00
parent 651df6b897
commit 200284a71a
9 changed files with 5334 additions and 2265 deletions

View File

@@ -13,116 +13,97 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
Get.put(TextToSpeechController());
return GetBuilder<MapPassengerController>(
builder: (controller) => Positioned(
top: Get.height * .008,
left: Get.width * .2,
child: Builder(builder: (context) {
return Row(
children: [
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
border: Border.all(),
color: AppColor.secondaryColor,
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.changeMapType();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.satellite_alt,
size: 29,
top: Get.height * .008,
left: Get.width * .02, // Adjust left position for better spacing
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround, // Distribute space evenly
children: [
_buildIconButtonWithAnimation(
controller: controller,
icon: Icons.satellite_alt,
onPressed: () => controller.changeMapType(),
tooltip: 'Toggle Map Type', // Add tooltips for better UX
),
const SizedBox(width: 8), // Consistent spacing
_buildIconButtonWithAnimation(
controller: controller,
icon: Icons.streetview_sharp,
onPressed: () => controller.changeMapTraffic(),
tooltip: 'Toggle Traffic',
),
const SizedBox(width: 8),
_buildIconButtonWithAnimation(
controller: controller,
icon: Icons.location_on,
onPressed: () {
controller.mapController?.animateCamera(
CameraUpdate.newLatLng(
LatLng(
controller.passengerLocation.latitude,
controller.passengerLocation.longitude,
),
),
),
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: () {
controller.changeMapTraffic();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.streetview_sharp,
size: 29,
),
),
),
const SizedBox(
width: 5,
),
// if (Platform.isIOS)
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.mapController?.animateCamera(
CameraUpdate.newLatLng(LatLng(
controller.passengerLocation.latitude,
controller.passengerLocation.longitude)));
},
icon: const Icon(
Icons.location_on,
size: 29,
),
),
),
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 {
Get.to(() => VipWaittingPage());
},
icon: const Icon(
Octicons.watch, // Replace this with your desired VIP icon
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 {
// final result = await sql.getCustomQuery('''
// SELECT * FROM ${TableName.recentLocations} ORDER BY createdAt DESC
// ''');
// },
// icon: const Icon(
// Octicons
// .telescope, // Replace this with your desired VIP icon
// size: 29,
// ),
// ),
// ),
],
);
})),
);
},
tooltip: 'Go to My Location',
),
const SizedBox(width: 8),
_buildIconButtonWithAnimation(
controller: controller,
icon: Octicons.watch,
onPressed: () => Get.to(() => VipWaittingPage()),
tooltip: 'VIP Waiting Page', // More descriptive tooltip
),
// const SizedBox(width: 8),
// _buildIconButtonWithAnimation(
// controller: controller,
// icon: Octicons.telescope,
// onPressed: () async {
// final result = await sql.getCustomQuery('''
// SELECT * FROM ${TableName.recentLocations} ORDER BY createdAt DESC
// ''');
// },
// tooltip: 'Recent Locations', // More descriptive tooltip
// ),
],
),
),
);
}
Widget _buildIconButtonWithAnimation({
required MapPassengerController controller,
required IconData icon,
required VoidCallback onPressed,
String? tooltip,
}) {
return AnimatedContainer(
duration: const Duration(milliseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.primaryColor,
border: Border.all(color: Colors.grey.shade400), // More subtle border
borderRadius: BorderRadius.circular(12), // Slightly less rounded
boxShadow: [
// Add a subtle shadow for depth
BoxShadow(
color: Colors.black.withOpacity(0.1),
spreadRadius: 0.5,
blurRadius: 3,
offset: const Offset(0, 1),
),
],
),
child: IconButton(
onPressed: onPressed,
icon: Icon(
icon,
size: 24, // Slightly smaller icon for a cleaner look
color: Colors.white, // Ensure good contrast
),
tooltip: tooltip,
splashRadius: 24, // Adjust splash radius for better feedback
),
);
}