8-28/1
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
@@ -8,6 +13,7 @@ import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_page_controller.dart';
|
||||
|
||||
GetBuilder<MapController> buttomSheetMapPage() {
|
||||
Get.put(PaymentController());
|
||||
return GetBuilder<MapController>(
|
||||
builder: (controller) => controller.isButtomSheetShown
|
||||
? Positioned(
|
||||
@@ -160,11 +166,28 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
||||
color: Colors.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => controller
|
||||
.changeCashConfirmPageShown(),
|
||||
child: Text(
|
||||
'CASH',
|
||||
style: AppStyle.title,
|
||||
onTap: () async {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
PaymentController()
|
||||
.getPassengerWallet();
|
||||
},
|
||||
child: GetBuilder<
|
||||
PaymentController>(
|
||||
builder:
|
||||
(paymentController) =>
|
||||
paymentController
|
||||
.isCashCheced
|
||||
? Text(
|
||||
'CASH',
|
||||
style: AppStyle
|
||||
.title,
|
||||
)
|
||||
: Text(
|
||||
'Sefer Wallet',
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -173,32 +196,238 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.qr_code_2_rounded,
|
||||
color: Colors.green[400],
|
||||
),
|
||||
Text(
|
||||
'Add Promo'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
GetBuilder<PaymentController>(
|
||||
builder:
|
||||
(paymentController) =>
|
||||
Container(
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons
|
||||
.qr_code_2_rounded,
|
||||
color: Colors
|
||||
.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.defaultDialog(
|
||||
title: 'Add Promo'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width:
|
||||
Get.width * .7,
|
||||
child:
|
||||
TextFormField(
|
||||
controller:
|
||||
paymentController.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,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title:
|
||||
'Add Promo'.tr,
|
||||
onPressed:
|
||||
() async {
|
||||
//TAWJIHI
|
||||
CRUD().get(link: AppLink.getPassengersPromo);
|
||||
Get.back();
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
},
|
||||
child: Text(
|
||||
'Add Promo'.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Confirm Selection'.tr,
|
||||
onPressed: () =>
|
||||
controller.changeConfirmRide(),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
title: 'How Many Passengers?'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
Text(
|
||||
'Allowed up to 4 Passengers.'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
height:
|
||||
200, // Set the desired height here
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32,
|
||||
onSelectedItemChanged:
|
||||
(index) {
|
||||
controller
|
||||
.onChangedPassengerCount(
|
||||
index + 1);
|
||||
},
|
||||
children: [
|
||||
Text('1 Passenger'.tr),
|
||||
Text('2 Passengers'.tr),
|
||||
Text('3 Passengers'.tr),
|
||||
Text('4 Passengers'.tr),
|
||||
],
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Back',
|
||||
onPressed: () => Get.back(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('How Many Passengers?'.tr,
|
||||
style: AppStyle.title),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all()),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(3.0),
|
||||
child: Text(
|
||||
controller
|
||||
.selectedPassengerCount
|
||||
.toString(),
|
||||
style: AppStyle.title),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Confirm Selection'.tr,
|
||||
onPressed: () {
|
||||
controller.changeConfirmRide();
|
||||
|
||||
// Get.to(() => UsePaypal(
|
||||
// sandboxMode: true,
|
||||
// clientId:
|
||||
// "AXE7bR3WzFEfAInUA2PBDOsW4zolx11Qr3jVOOjjJ7KGDLY3tnMIhZgyFT5Qkvj1NKWPaE8VZbG4UrZs",
|
||||
// secretKey:
|
||||
// "EJPW01FKqOm-SKKP16LQ_2cr3b124aZgmE0vi3JfbkWgLffv2xIjT4iCIfQv8RYn3W8h4DzxgZu_UxZC",
|
||||
// returnURL:
|
||||
// "https://samplesite.com/return",
|
||||
// cancelURL:
|
||||
// "https://samplesite.com/cancel",
|
||||
// transactions: const [
|
||||
// {
|
||||
// "amount": {
|
||||
// "total": '10.12',
|
||||
// "currency": "USD",
|
||||
// "details": {
|
||||
// "subtotal": '10.12',
|
||||
// "shipping": '0',
|
||||
// "shipping_discount": 0
|
||||
// }
|
||||
// },
|
||||
// "description":
|
||||
// "The payment transaction description.",
|
||||
// "payment_options": {
|
||||
// "allowed_payment_method":
|
||||
// "INSTANT_FUNDING_SOURCE"
|
||||
// },
|
||||
// "item_list": {
|
||||
// "items": [
|
||||
// {
|
||||
// "name":
|
||||
// "A demo product",
|
||||
// "quantity": 1,
|
||||
// "price": '10.12',
|
||||
// "currency": "USD"
|
||||
// }
|
||||
// ],
|
||||
// // shipping address is not required though
|
||||
// "shipping_address": {
|
||||
// "recipient_name":
|
||||
// "Jane Foster",
|
||||
// "line1": "Travis County",
|
||||
// "line2": "",
|
||||
// "city": "Austin",
|
||||
// "country_code": "US",
|
||||
// "postal_code": "73301",
|
||||
// "phone": "+00000000",
|
||||
// "state": "Texas"
|
||||
// },
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// note:
|
||||
// "Contact us for any questions on your order.",
|
||||
// onSuccess: (Map params) async {
|
||||
// print("onSuccess: $params");
|
||||
// },
|
||||
// onError: (error) {
|
||||
// print("onError: $error");
|
||||
// },
|
||||
// onCancel: (params) {
|
||||
// print('cancelled: $params');
|
||||
// },
|
||||
// )
|
||||
// );
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/functions/secure_storage.dart';
|
||||
import 'package:ride/controller/home/payment/payment_controller.dart';
|
||||
import 'package:ride/views/widgets/circle_container.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_page_controller.dart';
|
||||
import '../../../controller/payment/payment_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
class CashConfirmPageShown extends StatelessWidget {
|
||||
const CashConfirmPageShown({
|
||||
@@ -45,36 +51,41 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.wallet_outlined,
|
||||
size: 25,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Ride Wallet'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'Your Wallet balance is '.tr}JD 0.00',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Checkbox.adaptive(
|
||||
value: false,
|
||||
onChanged: (value) {},
|
||||
)
|
||||
],
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (controller) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.wallet_outlined,
|
||||
size: 25,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Ride Wallet'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
// '${'Your Wallet balance is '.tr}JD ',
|
||||
'${'Your Wallet balance is '.tr}JD ${box.read(BoxName.passengerWalletDetails)[0]['total'].toString()}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Checkbox.adaptive(
|
||||
value: controller.isWalletCheced,
|
||||
onChanged: (value) {
|
||||
controller.onChangedPymentethodWallet(value);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: AppColor.accentColor,
|
||||
@@ -100,10 +111,14 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Checkbox.adaptive(
|
||||
value: false,
|
||||
onChanged: (value) {},
|
||||
)
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (controller) => Checkbox.adaptive(
|
||||
value: controller.isCashCheced,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.onChangedPymentethodCash(value);
|
||||
},
|
||||
))
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
@@ -112,12 +127,16 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Add Payment Method'.tr,
|
||||
onPressed: () {
|
||||
controller.changePaymentMethodPageShown();
|
||||
CreditCardController().openPayment();
|
||||
})
|
||||
controller.cardNumber == null ||
|
||||
controller.cardNumber!.isEmpty
|
||||
? MyElevatedButton(
|
||||
title: 'Add Payment Method'.tr,
|
||||
onPressed: () {
|
||||
controller.changePaymentMethodPageShown();
|
||||
CreditCardController().openPayment();
|
||||
},
|
||||
)
|
||||
: const SizedBox()
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -5,6 +5,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';
|
||||
import '../../../main.dart';
|
||||
|
||||
@@ -61,10 +62,10 @@ GetBuilder<MapController> formSearchPlaces() {
|
||||
middleText: '',
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Confirm'.tr,
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
controller.clearpolyline();
|
||||
controller.data = [];
|
||||
controller.getMap(
|
||||
await controller.getMap(
|
||||
'${controller.mylocation.latitude.toString()},${controller.mylocation.longitude.toString()}',
|
||||
"${res['geometry']['location']['lat']},${res['geometry']['location']['lng']}");
|
||||
controller.places = [];
|
||||
@@ -100,6 +101,10 @@ GetBuilder<MapController> formSearchPlaces() {
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.placesFavorite);
|
||||
Toast.show(
|
||||
context,
|
||||
'${res['name']} ${'Saved Sucssefully'.tr}',
|
||||
AppColor.primaryColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
),
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/table_names.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
|
||||
class MainBottomMenuMap extends StatelessWidget {
|
||||
const MainBottomMenuMap({super.key});
|
||||
@@ -74,12 +75,12 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
animatedTexts: [
|
||||
ScaleAnimatedText(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// WavyAnimatedText(
|
||||
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// FlickerAnimatedText(
|
||||
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// WavyAnimatedText(
|
||||
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
WavyAnimatedText(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
FlickerAnimatedText(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
WavyAnimatedText(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
],
|
||||
isRepeatingAnimation: true,
|
||||
onTap: () {
|
||||
@@ -87,9 +88,11 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
Text('Nearst Car for you about '.tr +
|
||||
controller.nearestCar!.duration
|
||||
.toString())
|
||||
Text('Nearest Car for you about '.tr +
|
||||
(controller.nearestCar != null
|
||||
? controller.nearestCar!.duration
|
||||
.toString()
|
||||
: 'N/A'))
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -193,10 +196,15 @@ class FavioratePlacesDialogu extends StatelessWidget {
|
||||
TableName.placesFavorite,
|
||||
favoritePlaces[index]['id']);
|
||||
Get.back();
|
||||
Get.snackbar('Deleted'.tr,
|
||||
// ignore: use_build_context_synchronously
|
||||
Toast.show(
|
||||
context,
|
||||
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
backgroundColor:
|
||||
AppColor.accentColor);
|
||||
AppColor.redColor);
|
||||
// Get.snackbar('Deleted'.tr,
|
||||
// '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
// backgroundColor:
|
||||
// AppColor.accentColor);
|
||||
},
|
||||
icon:
|
||||
const Icon(Icons.favorite_outlined),
|
||||
|
||||
@@ -85,18 +85,24 @@ class PaymentMethodPage extends StatelessWidget {
|
||||
MyElevatedButton(
|
||||
title: 'Add Credit Card'.tr,
|
||||
onPressed: () async {
|
||||
SecureStorage().saveData(
|
||||
BoxName.cardNumber,
|
||||
controller.cardNumberController.text);
|
||||
SecureStorage().saveData(
|
||||
BoxName.cardHolderName,
|
||||
controller
|
||||
.cardHolderNameController.text);
|
||||
SecureStorage().saveData(BoxName.cvvCode,
|
||||
controller.cvvCodeController.text);
|
||||
SecureStorage().saveData(
|
||||
BoxName.expiryDate,
|
||||
controller.expiryDateController.text);
|
||||
if (controller.formKey.currentState!
|
||||
.validate()) {
|
||||
SecureStorage().saveData(
|
||||
BoxName.cardNumber,
|
||||
controller
|
||||
.cardNumberController.text);
|
||||
SecureStorage().saveData(
|
||||
BoxName.cardHolderName,
|
||||
controller
|
||||
.cardHolderNameController.text);
|
||||
SecureStorage().saveData(
|
||||
BoxName.cvvCode,
|
||||
controller.cvvCodeController.text);
|
||||
SecureStorage().saveData(
|
||||
BoxName.expiryDate,
|
||||
controller
|
||||
.expiryDateController.text);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user