24-12/26/1
This commit is contained in:
@@ -15,162 +15,182 @@ import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../notification/notification_page.dart';
|
||||
import '../../widgets/icon_widget_menu.dart';
|
||||
import '../setting_page.dart';
|
||||
import '../profile/passenger_profile_page.dart';
|
||||
|
||||
class MapMenuWidget extends StatelessWidget {
|
||||
const MapMenuWidget({
|
||||
super.key,
|
||||
});
|
||||
const MapMenuWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Stack(children: [
|
||||
Positioned(
|
||||
right: 60,
|
||||
left: 60,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 20),
|
||||
child: Opacity(
|
||||
alwaysIncludeSemantics: false,
|
||||
opacity: 1, // Adjust the opacity value as needed
|
||||
child: AnimatedContainer(
|
||||
width: Get.width * .6,
|
||||
decoration: AppStyle.boxDecoration
|
||||
.copyWith(color: AppColor.blueColor),
|
||||
transform: Matrix4.translationValues(
|
||||
controller.heightMenu * .1, 1, 1),
|
||||
curve: Curves.easeOutCubic,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.heightMenu,
|
||||
child: controller.heightMenuBool
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconWidgetMenu(
|
||||
onpressed: () {
|
||||
builder: (controller) => Stack(
|
||||
children: [
|
||||
// Top Menu Bar
|
||||
Positioned(
|
||||
top: 10, // Adjust as needed
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
// GestureDetector(
|
||||
// onTap: controller.getDrawerMenu,
|
||||
// child: Container(
|
||||
// padding: const EdgeInsets.all(10),
|
||||
// decoration: AppStyle.boxDecoration
|
||||
// .copyWith(color: AppColor.blueColor),
|
||||
// child: const Icon(Icons.menu, color: Colors.white),
|
||||
// ),
|
||||
// ),
|
||||
if (controller.heightMenuBool)
|
||||
Expanded(
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: 50, // Fixed height for the top menu
|
||||
margin: const EdgeInsets.only(left: 10),
|
||||
decoration: AppStyle.boxDecoration
|
||||
.copyWith(color: AppColor.blueColor),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.to(
|
||||
() => const NotificationPage(),
|
||||
transition: Transition.circularReveal,
|
||||
);
|
||||
},
|
||||
title: 'Notifications'.tr,
|
||||
icon: Icons.notifications),
|
||||
IconWidgetMenu(
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => PassengerProfilePage(),
|
||||
transition: Transition.zoom,
|
||||
);
|
||||
},
|
||||
icon: Icons.person,
|
||||
title: 'Profile'.tr,
|
||||
),
|
||||
IconWidgetMenu(
|
||||
title: 'Home'.tr,
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => const SettingPage(),
|
||||
transition: Transition.downToUp,
|
||||
curve: Curves.easeInOutExpo,
|
||||
);
|
||||
icon: const Icon(Icons.notifications,
|
||||
color: Colors.white),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.to(() => PassengerProfilePage(),
|
||||
transition: Transition.zoom);
|
||||
},
|
||||
icon: Icons.settings),
|
||||
],
|
||||
)
|
||||
: const SizedBox(), // Choose the desired overlay color
|
||||
)),
|
||||
icon: const Icon(Icons.person,
|
||||
color: Colors.white),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const SettingPage(),
|
||||
transition: Transition.downToUp,
|
||||
curve: Curves.easeInOutExpo);
|
||||
},
|
||||
icon: const Icon(Icons.settings,
|
||||
color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 5,
|
||||
top: 80,
|
||||
// Side Drawer (Main Menu)
|
||||
Positioned(
|
||||
top: 80, // Adjust as needed
|
||||
left: 10,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
width: controller.widthMenu,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const PassengerWallet());
|
||||
},
|
||||
title: 'My Wallet'.tr,
|
||||
icon: Icons.wallet,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () async {
|
||||
Get.to(() => const OrderHistory());
|
||||
},
|
||||
title: 'Order History'.tr,
|
||||
icon: Icons.history,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => ContactUsPage());
|
||||
},
|
||||
title: "Contact Us".tr,
|
||||
icon: Icons.contact_page,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Positioned(
|
||||
left: 5,
|
||||
top: 80,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
width: controller.widthMenu,
|
||||
height: Get.height * .3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconMainPageMap(
|
||||
onTap: () async {
|
||||
final String driverAppUrl;
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
driverAppUrl =
|
||||
'https://play.google.com/store/apps/details?id=com.sefer_driver&pli=1'; // Replace with your driver app's Play Store URL
|
||||
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
driverAppUrl =
|
||||
'https://apps.apple.com/app/sefer-driver/id6502189302'; // Replace with your driver app's App Store ID
|
||||
} else {
|
||||
// Handle other platforms or unknown platform (optional)
|
||||
return;
|
||||
}
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 250), // Add max width constraint
|
||||
|
||||
if (await canLaunchUrl(Uri.parse(driverAppUrl))) {
|
||||
await launchUrl(Uri.parse(driverAppUrl));
|
||||
} else {
|
||||
throw 'Could not launch app store URL';
|
||||
}
|
||||
},
|
||||
title: 'Driver'.tr,
|
||||
icon: WeatherIcons.wi_moon_14,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
child: Material(
|
||||
color: Colors.white, // Background color of the drawer
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const PassengerWallet());
|
||||
},
|
||||
title: 'My Wallet'.tr,
|
||||
icon: Icons.wallet,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () async {
|
||||
Get.to(() => const OrderHistory());
|
||||
},
|
||||
title: 'Order History'.tr,
|
||||
icon: Icons.history,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => ContactUsPage());
|
||||
},
|
||||
title: "Contact Us".tr,
|
||||
icon: Icons.contact_page,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () async {
|
||||
final String driverAppUrl;
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
driverAppUrl =
|
||||
'https://play.google.com/store/apps/details?id=your_android_driver_app_id'; // Replace with your driver app's Play Store URL
|
||||
} else if (defaultTargetPlatform ==
|
||||
TargetPlatform.iOS) {
|
||||
driverAppUrl =
|
||||
'https://apps.apple.com/app/your_ios_driver_app_id'; // Replace with your driver app's App Store ID
|
||||
} else {
|
||||
// Handle other platforms or unknown platform (optional)
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
final Uri url = Uri.parse(driverAppUrl);
|
||||
if (await canLaunchUrl(url)) {
|
||||
await launchUrl(url);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
'Could not launch driver app store.',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint('Error launching URL: $e');
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
'Could not open the link.',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
}
|
||||
},
|
||||
title: 'Driver'.tr,
|
||||
icon: WeatherIcons.wi_moon_14,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => ComplaintPage());
|
||||
},
|
||||
title: 'Complaint'.tr,
|
||||
icon: Icons.feedback,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const PromosPassengerPage());
|
||||
},
|
||||
title: 'Promos'.tr,
|
||||
icon: Icons.monetization_on,
|
||||
),
|
||||
],
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => ComplaintPage());
|
||||
},
|
||||
title: 'Complaint'.tr,
|
||||
icon: Icons.feedback,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const PromosPassengerPage());
|
||||
},
|
||||
title: 'Promos'.tr,
|
||||
icon: Icons.monetization_on,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
))
|
||||
]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -189,29 +209,21 @@ class IconMainPageMap extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder(
|
||||
future: Future.delayed(const Duration(milliseconds: 400)),
|
||||
builder: (context, snapshot) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: SizedBox(
|
||||
height: Get.height * .1,
|
||||
width: double.maxFinite,
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Icon(icon),
|
||||
Text(
|
||||
title.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 1),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, size: 24),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
title.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
);
|
||||
});
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user