import 'package:Tripz/controller/firebase/firbase_messge.dart'; import 'package:Tripz/controller/functions/encrypt_decrypt.dart'; import 'package:Tripz/views/auth/sms_verfy_page.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:flutter_font_icons/flutter_font_icons.dart'; import 'package:get/get.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import '../../../constant/colors.dart'; import '../../../constant/table_names.dart'; import '../../../controller/functions/secure_storage.dart'; import '../../../controller/functions/tts.dart'; import '../../../controller/home/map_passenger_controller.dart'; import '../../../controller/home/vip_waitting_page.dart'; import '../../../main.dart'; import '../../../print.dart'; GetBuilder leftMainMenuIcons() { Get.put(TextToSpeechController()); return GetBuilder( builder: (controller) => Positioned( top: Get.height * .008, left: Get.width * .16, right: Get.width * .16, // Adjust left position for better spacing child: Row( mainAxisAlignment: MainAxisAlignment.center, // 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, ), ), ); }, 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.screen_full, // onPressed: () async { // Get.to(() => TestPage()); // }, // tooltip: 'Recent Locations', // More descriptive tooltip // ), ], ), ), ); } class TestPage extends StatelessWidget { const TestPage({ super.key, }); @override Widget build(BuildContext context) { final firebaseMessagesController = Get.isRegistered() ? Get.find() : Get.put(FirebaseMessagesController()); return Scaffold( appBar: AppBar(), body: Center( child: TextButton( onPressed: () async { firebaseMessagesController.sendNotificationToDriverMAP( 'Order', 'body', 'c2tXiuBJQCSg4CU4IfqYOL:APA91bFA0f8R3QMnPQnPEEdNyjY-jcoKt4nLBHxcLLsmDSuJn5yd4jSvwq7qDIZpkkPkjfjdwdKsGL0-G0aHpPyjfiBvbCwFmlRMCUKftNMNT7MJx2Bp16Y', [ "32.1117875", "36.0669891", "32.1364001", "36.0707479", "24.84", "7.56", "436", "4.38", "109270481246447459618", "113172279072358305645", "hamza", "e4QWqe7K607luM7qUMOPCL:APA91bFjX4XBM4I5COJl9fyxCTKJ1ZQpT3vzY7iEbOTuT4uo0-OSCAt5zgVhlhw4aC33s-VhyucDnP1tQGFd9svaazQ8A_SKgolPk3owzug8dCsiXoPeJ0k", "+201010101010", "6", "43", "true", "c2tXiuBJQCSg4CU4IfqYOL:APA91bFA0f8R3QMnPQnPEEdNyjY-jcoKt4nLBHxcLLsmDSuJn5yd4jSvwq7qDIZpkkPkjfjdwdKsGL0-G0aHpPyjfiBvbCwFmlRMCUKftNMNT7MJx2Bp16Y", "6", "1188", "false", "109270481246447459618", "436", "startEnd", "32.12404505187645", "36.06566168367863", "", "", "", "", "5.42", "0", "hamzaayedflutter@gmail.com", "4368+PPP، السخنة، الأردن", "43PC+C4G، السخنة، الأردن", "Speed", "8", "5.00" ], 'ding.wav'); // await AppInitializer().getAIKey(Pasenger.FCM_PRIVATE_KEY); }, child: Text( "Text Button", ), ), ), ); } } 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 ), ); }