This commit is contained in:
Hamza-Ayed
2023-09-05 11:24:45 +03:00
parent ef6d3604cd
commit 4380826253
9 changed files with 418 additions and 158 deletions

View File

@@ -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,