This commit is contained in:
Hamza-Ayed
2023-08-28 19:13:50 +03:00
parent 63770619d6
commit 069ab52a83
63 changed files with 621 additions and 104 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1021 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -14,4 +14,6 @@ class BoxName {
static const String cardHolderName = "cardHolderName";
static const String expiryDate = "expiryDate";
static const String cvvCode = "cvvCode";
static const String passengerWalletDetails = "passengerWalletDetails";
static const String passengerWalletTotal = "passengerWalletTotal";
}

View File

@@ -7,7 +7,24 @@ class AppLink {
static const String getTokens = "$server/ride/firebase/get.php";
static const String addTokens = "$server/ride/firebase/add.php";
//=======================ride===================
//=======================Wallet===================
static const String wallet = '$server/ride/passengerWallet/';
static const String getAllPassengerTransaction =
"$wallet/getAllPassengerTransaction.php";
static const String getWalletByPassenger = "$wallet/getWalletByPassenger.php";
static const String getPassengersWallet = "$wallet/get.php";
static const String addPassengersWallet = "$wallet/add.php";
static const String deletePassengersWallet = "$wallet/delete.php";
static const String updatePassengersWallet = "$wallet/update.php";
//=======================promo===================ride.mobile-app.store/ride/promo/get.php
static const String promo = '$server/ride/promo';
static const String getPassengersPromo = "$promo/get.php";
static const String addPassengersPromo = "$promo/add.php";
static const String deletePassengersPromo = "$promo/delete.php";
static const String updatePassengersPromo = "$promo/update.php";
////=======================ride===================
static const String ride = '$server/ride/';
static const String addCancelRide = "$server/ride/cancelRide/add.php";
static const String cancelRide = "$server/ride/cancelRide/get.php";

View File

@@ -21,8 +21,8 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
},
);
// print("--------------" + response.body.toString());
// print("--------------" + payload.toString());
print("--------------" + response.request.toString());
print("--------------" + payload.toString());
if (response.statusCode == 200) {
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {

View File

@@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ride/constant/colors.dart';
import 'package:ride/constant/style.dart';
class Toast {
static void show(BuildContext context, String message, Color color) {
final snackBar = SnackBar(
clipBehavior: Clip.antiAliasWithSaveLayer,
backgroundColor: color,
elevation: 3,
content: Text(
message,
style: AppStyle.title.copyWith(color: AppColor.secondaryColor),
),
behavior: SnackBarBehavior.floating,
animation: const AlwaysStoppedAnimation(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), // Custom border radius
),
width: Get.width * .8,
// shape: const StadiumBorder(
// side: BorderSide(
// color: AppColor.secondaryColor,
// width: 1.0,
// style: BorderStyle.solid,
// )),
duration: const Duration(seconds: 2),
);
ScaffoldMessenger.of(context).showSnackBar(
snackBar,
);
}
}

View File

@@ -11,6 +11,7 @@ import 'package:ride/constant/box_name.dart';
import 'package:ride/constant/credential.dart';
import 'package:ride/constant/links.dart';
import 'package:ride/controller/functions/crud.dart';
import 'package:ride/controller/functions/secure_storage.dart';
import 'package:ride/views/widgets/elevated_btn.dart';
import '../../main.dart';
import '../../models/model/locations.dart';
@@ -55,6 +56,13 @@ class MapController extends GetxController {
var dataCarsLocationByPassenger;
CarLocation? nearestCar;
late Timer markerReloadingTimer;
int selectedPassengerCount = 1;
void onChangedPassengerCount(int newValue) {
selectedPassengerCount = newValue;
update();
}
// final mainBottomMenuMap = GlobalKey<AnimatedContainer>();
void changeButtomSheetShown() {
isButtomSheetShown = !isButtomSheetShown;
@@ -110,6 +118,7 @@ class MapController extends GetxController {
changeConfirmRide() {
rideConfirm = true;
print('rideConfirm= $rideConfirm');
//TODO add ride and get ride id and details
update();
}
@@ -403,7 +412,7 @@ class MapController extends GetxController {
// longitude: double.parse(carLocation['longitude']),
// );
// }
isloading = true;
update();
// Make API request to get exact distance and duration
String apiUrl =
@@ -426,6 +435,7 @@ class MapController extends GetxController {
latitude: double.parse(carLocation['latitude']),
longitude: double.parse(carLocation['longitude']),
);
isloading = false;
update();
}
}
@@ -701,7 +711,7 @@ class MapController extends GetxController {
}
List<LatLng> polylineCoordinate = [];
String? cardNumber;
@override
void onInit() async {
await getLocation();
@@ -710,7 +720,7 @@ class MapController extends GetxController {
addCustomPicker();
addCustomCarIcon();
startMarkerReloading();
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
super.onInit();
}
}
@@ -719,8 +729,8 @@ class CarLocation {
final int id;
final double latitude;
final double longitude;
double distance;
double duration;
final double distance;
final double duration;
CarLocation({
required this.id,

View File

@@ -86,7 +86,10 @@ class MyTranslation extends Translations {
"هل ترغب في الانتقال إلى هذا الموقع",
"MyLocation": "موقعي",
"my location": "موقعي",
"Target": "هدف"
"Target": "هدف",
/////
///
// 'Saved Sucssefully':
},
"tr": {
"Choose Language": "Dil Seçin",

View File

@@ -0,0 +1,59 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../constant/box_name.dart';
import '../../constant/links.dart';
import '../../main.dart';
import '../functions/crud.dart';
class PaymentController extends GetxController {
bool isloading = false;
bool isWalletCheced = false;
bool isCashCheced = false;
final formKey = GlobalKey<FormState>();
final promo = TextEditingController();
getPassengerWallet() async {
isloading = true;
update();
if (box.read(BoxName.passengerWalletDetails) == null) {
await CRUD().get(link: AppLink.getWalletByPassenger, payload: {
'passenger_id': box.read(BoxName.pasengerID)
}).then((value) {
final total = jsonDecode(value)['message'];
box.write(BoxName.passengerWalletDetails, total);
});
isloading = false;
update();
print('from empty');
print(box.read(BoxName.passengerWalletDetails));
} else {
box.read(BoxName.passengerWalletDetails);
update();
print('from full');
print(box.read(BoxName.passengerWalletDetails));
}
}
void onChangedPymentethodWallet(bool? value) {
isWalletCheced = !isWalletCheced;
isWalletCheced ? isCashCheced = false : isCashCheced = true;
update();
}
void onChangedPymentethodCash(bool? value) {
isCashCheced = !isCashCheced;
isCashCheced ? isWalletCheced = false : isWalletCheced = true;
update();
}
@override
void onInit() {
getPassengerWallet();
super.onInit();
}
}

View File

@@ -53,6 +53,14 @@ class LoginPage extends StatelessWidget {
TextInputType.emailAddress,
controller: controller.emailController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius:
BorderRadius.circular(10),
),
fillColor: AppColor.accentColor,
hoverColor: AppColor.accentColor,
focusColor: AppColor.accentColor,
@@ -81,6 +89,14 @@ class LoginPage extends StatelessWidget {
cursorColor: AppColor.accentColor,
controller: controller.phoneController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius:
BorderRadius.circular(10),
),
focusColor: AppColor.accentColor,
fillColor: AppColor.accentColor,
border: const OutlineInputBorder(
@@ -109,6 +125,14 @@ class LoginPage extends StatelessWidget {
controller:
controller.passwordController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius:
BorderRadius.circular(10),
),
fillColor: AppColor.accentColor,
hoverColor: AppColor.accentColor,
focusColor: AppColor.accentColor,

View File

@@ -44,6 +44,13 @@ class RegisterPage extends StatelessWidget {
keyboardType: TextInputType.text,
controller: controller.firstNameController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
fillColor: AppColor.accentColor,
hoverColor: AppColor.accentColor,
focusColor: AppColor.accentColor,
@@ -67,6 +74,13 @@ class RegisterPage extends StatelessWidget {
keyboardType: TextInputType.text,
controller: controller.lastNameController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
focusColor: AppColor.accentColor,
fillColor: AppColor.accentColor,
border: const OutlineInputBorder(
@@ -92,6 +106,13 @@ class RegisterPage extends StatelessWidget {
keyboardType: TextInputType.emailAddress,
controller: controller.emailController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
fillColor: AppColor.accentColor,
hoverColor: AppColor.accentColor,
focusColor: AppColor.accentColor,
@@ -118,6 +139,13 @@ class RegisterPage extends StatelessWidget {
keyboardType: TextInputType.emailAddress,
controller: controller.passwordController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
fillColor: AppColor.accentColor,
hoverColor: AppColor.accentColor,
focusColor: AppColor.accentColor,
@@ -147,6 +175,13 @@ class RegisterPage extends StatelessWidget {
cursorColor: AppColor.accentColor,
controller: controller.phoneController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
focusColor: AppColor.accentColor,
fillColor: AppColor.accentColor,
border: const OutlineInputBorder(
@@ -169,6 +204,13 @@ class RegisterPage extends StatelessWidget {
keyboardType: TextInputType.text,
controller: controller.siteController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
focusColor: AppColor.accentColor,
fillColor: AppColor.accentColor,
border: const OutlineInputBorder(

View File

@@ -7,6 +7,7 @@ import 'package:ride/views/home/map_widget.dart/cancel_raide_page.dart';
import 'package:ride/views/widgets/circle_container.dart';
import 'package:ride/views/widgets/mycircular.dart';
import '../../controller/functions/toast.dart';
import '../../controller/home/menu_controller.dart';
import 'map_widget.dart/buttom_sheet_map_show.dart';
import 'map_widget.dart/cash_confirm_bottom_page.dart';
@@ -153,7 +154,7 @@ class MapPage extends StatelessWidget {
child: IconButton(
onPressed: () {
controller.changeMapType();
controller.reloadMarkers();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.satellite_alt,

View File

@@ -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');
// },
// )
// );
},
),
],
)
],
),

View File

@@ -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()
],
),
),

View File

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

View File

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

View File

@@ -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);
}
},
),
],

View File

@@ -230,6 +230,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.0+1"
flutter_paypal:
dependency: "direct main"
description:
name: flutter_paypal
sha256: "783d52ca84528b4b7a1213db5195e6946a2d27b2192f4fcd6d0b04b8c37e359e"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
@@ -286,6 +294,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
flutter_spinkit:
dependency: transitive
description:
name: flutter_spinkit
sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e
url: "https://pub.dev"
source: hosted
version: "5.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -488,6 +504,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.13.6"
http_auth:
dependency: transitive
description:
name: http_auth
sha256: b63ab2b2874970e92b76b7d23c805e74d7c534e8528088da75cf32c18e9abe25
url: "https://pub.dev"
source: hosted
version: "1.0.3"
http_parser:
dependency: transitive
description:
@@ -877,6 +901,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
webview_flutter:
dependency: transitive
description:
name: webview_flutter
sha256: "04a0782fb058b7c71f2048935583488f4d32e9147ca403abc4e58f1de9964629"
url: "https://pub.dev"
source: hosted
version: "4.2.3"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
sha256: bca797abba472868655b5f1a6029c1132385685ee9db4713cb0e7f33076210c6
url: "https://pub.dev"
source: hosted
version: "3.9.3"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
sha256: "0ca3cfcc6781a7de701d580917af4a9efc4e3e129f8ead95a80587f0a749480a"
url: "https://pub.dev"
source: hosted
version: "2.5.0"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: ed749f94ac9e814d04a258a9255cf69cfa4cc6006ff59542aea7fb4590144972
url: "https://pub.dev"
source: hosted
version: "3.7.3"
win32:
dependency: transitive
description:

View File

@@ -56,6 +56,7 @@ dependencies:
flutter_secure_storage: ^8.0.0
credit_card_scanner: ^1.0.5
geolocator: ^10.0.0
flutter_paypal: ^0.2.0
dev_dependencies:
flutter_test: