9/5/1
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map_page_controller.dart';
|
||||
|
||||
GetBuilder<MapController> buttomSheetMapPage() {
|
||||
@@ -233,62 +234,70 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get
|
||||
.defaultDialog(
|
||||
title: 'Add Promo'
|
||||
.tr,
|
||||
content:
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .7,
|
||||
child: TextFormField(
|
||||
controller: controller.promo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Promo Code'.tr,
|
||||
hintText: 'Enter promo code'.tr,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
if (controller
|
||||
.promoTaken ==
|
||||
false) {
|
||||
Get.defaultDialog(
|
||||
title: 'Add Promo'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width:
|
||||
Get.width * .7,
|
||||
child:
|
||||
TextFormField(
|
||||
controller: controller.promo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Promo Code'.tr,
|
||||
hintText: 'Enter promo code'.tr,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[200],
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[200],
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red,
|
||||
width: 2.0,
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Add Promo'.tr,
|
||||
onPressed: () async {
|
||||
if (controller.promoTaken == false) {
|
||||
controller.applyPromoCodetoPassenger();
|
||||
Get.back();
|
||||
} else {
|
||||
Get.defaultDialog(title: 'You have Promo ?.'.tr);
|
||||
}
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
),
|
||||
MyElevatedButton(
|
||||
title:
|
||||
'Add Promo'.tr,
|
||||
onPressed:
|
||||
() async {
|
||||
controller.applyPromoCodetoPassenger();
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'You have promo!'
|
||||
.tr,
|
||||
'',
|
||||
backgroundColor:
|
||||
AppColor
|
||||
.redColor);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Add Promo'.tr,
|
||||
|
||||
@@ -43,31 +43,32 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .1,
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(2, 4)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(-2, -2))
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.elliptical(15, 30),
|
||||
child: InkWell(
|
||||
onTap: () => controller.changeMainBottomMenuMap(),
|
||||
child: Container(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .1,
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(2, 4)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(-2, -2))
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.elliptical(15, 30),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () => controller.changeMainBottomMenuMap(),
|
||||
child: DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
@@ -88,16 +89,33 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
Text('Nearest Car for you about '.tr +
|
||||
(controller.nearestCar != null
|
||||
? controller.nearestCar!.duration
|
||||
.toString()
|
||||
: 'N/A'))
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('Nearest Car for you about '.tr),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.redColor,
|
||||
width: 3)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Text(
|
||||
(controller.nearestCar != null
|
||||
? controller
|
||||
.duratioByPassenger
|
||||
.toString()
|
||||
: 'N/A')),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
)),
|
||||
),
|
||||
),
|
||||
controller.isMainBottomMenuMap
|
||||
? const FavioratePlacesDialogu()
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/views/home/my_wallet/passenger_wallet.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_page_controller.dart';
|
||||
@@ -16,76 +19,221 @@ class MapMenuWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapController>(
|
||||
builder: (controller) => Positioned(
|
||||
right: 60,
|
||||
left: 60,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 20),
|
||||
child: Opacity(
|
||||
alwaysIncludeSemantics: false,
|
||||
opacity: 0.99, // Adjust the opacity value as needed
|
||||
child: AnimatedContainer(
|
||||
width: Get.width * .6,
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.primaryColor,
|
||||
offset: Offset(-7, -7),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer)
|
||||
]),
|
||||
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(
|
||||
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: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(-3, -3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer)
|
||||
]),
|
||||
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: () {
|
||||
Get.to(
|
||||
() => const NotificationPage(),
|
||||
transition: Transition.circularReveal,
|
||||
);
|
||||
},
|
||||
title: 'Notifications'.tr,
|
||||
icon: Icons.notifications),
|
||||
IconWidgetMenu(
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => const NotificationPage(),
|
||||
transition: Transition.circularReveal,
|
||||
() => const PassengerProfilePage(),
|
||||
transition: Transition.zoom,
|
||||
);
|
||||
},
|
||||
title: 'Notifications'.tr,
|
||||
icon: Icons.notifications),
|
||||
IconWidgetMenu(
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => const PassengerProfilePage(),
|
||||
transition: Transition.zoom,
|
||||
);
|
||||
},
|
||||
icon: Icons.person,
|
||||
title: 'Profile'.tr,
|
||||
),
|
||||
IconWidgetMenu(
|
||||
title: 'Home'.tr,
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => const HomePage(),
|
||||
transition: Transition.downToUp,
|
||||
curve: Curves.easeInOutExpo,
|
||||
);
|
||||
},
|
||||
icon: Icons.home),
|
||||
],
|
||||
)
|
||||
: const SizedBox(), // Choose the desired overlay color
|
||||
)),
|
||||
icon: Icons.person,
|
||||
title: 'Profile'.tr,
|
||||
),
|
||||
IconWidgetMenu(
|
||||
title: 'Home'.tr,
|
||||
onpressed: () {
|
||||
Get.to(
|
||||
() => const HomePage(),
|
||||
transition: Transition.downToUp,
|
||||
curve: Curves.easeInOutExpo,
|
||||
);
|
||||
},
|
||||
icon: Icons.home),
|
||||
],
|
||||
)
|
||||
: const SizedBox(), // Choose the desired overlay color
|
||||
)),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 5,
|
||||
top: 110,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(-3, -3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer)
|
||||
]),
|
||||
width: controller.widthMenu,
|
||||
height: Get.height * .3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const PassengerWallet());
|
||||
},
|
||||
title: 'My Wallet',
|
||||
icon: Icons.wallet,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {},
|
||||
title: 'Order History',
|
||||
icon: Icons.history,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {},
|
||||
title: 'Tariff',
|
||||
icon: Icons.money,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Positioned(
|
||||
left: 5,
|
||||
top: 110,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(-3, -3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer)
|
||||
]),
|
||||
width: controller.widthMenu,
|
||||
height: Get.height * .3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconMainPageMap(
|
||||
onTap: () {},
|
||||
title: 'Settings',
|
||||
icon: Icons.settings,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {},
|
||||
title: 'Feed Back',
|
||||
icon: Icons.feedback,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {},
|
||||
title: 'Promos',
|
||||
icon: Icons.monetization_on,
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class IconMainPageMap extends StatelessWidget {
|
||||
const IconMainPageMap({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.onTap,
|
||||
required this.icon,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final IconData icon;
|
||||
final Callback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Icon(icon),
|
||||
Text(
|
||||
title.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
59
lib/views/home/my_wallet/passenger_wallet.dart
Normal file
59
lib/views/home/my_wallet/passenger_wallet.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
|
||||
class PassengerWallet extends StatelessWidget {
|
||||
const PassengerWallet({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(PaymentController());
|
||||
return MyScafolld(
|
||||
title: 'My Wallet',
|
||||
isleading: true,
|
||||
body: [
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(-1, -1),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.normal),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 1,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.normal)
|
||||
]),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Text(
|
||||
'You Have ${controller.passengerTotalWalletAmount} JD in SEFER Wallet',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user