4/18/1
This commit is contained in:
@@ -160,7 +160,7 @@ class MyTranslation extends Translations {
|
|||||||
"Copy this Promo to use it in your Ride!":
|
"Copy this Promo to use it in your Ride!":
|
||||||
"انسخ هذا العرض لاستخدامه في رحلتك!",
|
"انسخ هذا العرض لاستخدامه في رحلتك!",
|
||||||
"To change some Settings": "لتغيير بعض الإعدادات",
|
"To change some Settings": "لتغيير بعض الإعدادات",
|
||||||
"To change Languge the App": "لتغيير لغة التطبيق",
|
"To change Language the App": "لتغيير لغة التطبيق",
|
||||||
"Order Request Page": "صفحة طلب الطلب",
|
"Order Request Page": "صفحة طلب الطلب",
|
||||||
"Rouats of Trip": "طرق الرحلة",
|
"Rouats of Trip": "طرق الرحلة",
|
||||||
"Passenger Name is ": "اسم الراكب هو ",
|
"Passenger Name is ": "اسم الراكب هو ",
|
||||||
@@ -688,6 +688,9 @@ class MyTranslation extends Translations {
|
|||||||
"إذا كنت تريد أن تفتح تطبيق خرائط جوجل مباشرة عند طلب الخدمة",
|
"إذا كنت تريد أن تفتح تطبيق خرائط جوجل مباشرة عند طلب الخدمة",
|
||||||
"You can change the language of the app": "يمكنك تغيير لغة التطبيق",
|
"You can change the language of the app": "يمكنك تغيير لغة التطبيق",
|
||||||
'Your Budget less than needed': 'القيمه المدخله اقل من رصيدك',
|
'Your Budget less than needed': 'القيمه المدخله اقل من رصيدك',
|
||||||
|
'You can change the Country to get all features':
|
||||||
|
'يمكنك تغيير البلد للحصول على جميع الميزات',
|
||||||
|
'Change Country': 'تغيير الدولة',
|
||||||
},
|
},
|
||||||
"tr": {
|
"tr": {
|
||||||
"Choose Language": "Dil Seçin",
|
"Choose Language": "Dil Seçin",
|
||||||
@@ -849,7 +852,7 @@ class MyTranslation extends Translations {
|
|||||||
"Copy this Promo to use it in your Ride!":
|
"Copy this Promo to use it in your Ride!":
|
||||||
"Bu Promosyonu seyahatinizde kullanmak için kopyalayın!",
|
"Bu Promosyonu seyahatinizde kullanmak için kopyalayın!",
|
||||||
"To change some Settings": "Bazı ayarları değiştirmek için",
|
"To change some Settings": "Bazı ayarları değiştirmek için",
|
||||||
"To change Languge the App": "Uygulama dilini değiştirmek için",
|
"To change Language the App": "Uygulama dilini değiştirmek için",
|
||||||
"Order Request Page": "Sipariş istek sayfası",
|
"Order Request Page": "Sipariş istek sayfası",
|
||||||
"Rouats of Trip": "Seyahat yolları",
|
"Rouats of Trip": "Seyahat yolları",
|
||||||
"Passenger Name is ": "Yolcu adı ",
|
"Passenger Name is ": "Yolcu adı ",
|
||||||
|
|||||||
@@ -496,6 +496,7 @@ class PaymentController extends GetxController {
|
|||||||
),
|
),
|
||||||
confirm: MyElevatedButton(
|
confirm: MyElevatedButton(
|
||||||
title: 'OK'.tr,
|
title: 'OK'.tr,
|
||||||
|
kolor: AppColor.greenColor,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
method();
|
method();
|
||||||
@@ -543,11 +544,13 @@ class PaymentController extends GetxController {
|
|||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
title: 'Payment Successful'.tr,
|
title: 'Payment Successful'.tr,
|
||||||
titleStyle: AppStyle.title,
|
titleStyle: AppStyle.title,
|
||||||
|
// backgroundColor: AppColor.greenColor,
|
||||||
content: Text(
|
content: Text(
|
||||||
'The payment was approved.'.tr,
|
'The payment was approved.'.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
confirm: MyElevatedButton(
|
confirm: MyElevatedButton(
|
||||||
|
kolor: AppColor.greenColor,
|
||||||
title: 'OK'.tr,
|
title: 'OK'.tr,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|||||||
@@ -39,14 +39,66 @@ class PaymobManager extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> payWithPayMob(int amount, String currency) async {
|
Future<void> payWithPayMob(int amount, String currency) async {
|
||||||
String key = await PaymobManager().getPaymentKey(amount, currency);
|
// 1. Fetch Payment Key (Assuming PaymobManager is a custom class)
|
||||||
await launchUrl(
|
String paymentToken;
|
||||||
Uri.parse(
|
try {
|
||||||
'https://accept.paymob.com/api/acceptance/iframes/837992?payment_token=$key'),
|
paymentToken = await PaymobManager().getPaymentKey(amount, currency);
|
||||||
|
} on Exception catch (e) {
|
||||||
|
// Handle errors gracefully, e.g., display error message to user
|
||||||
|
print("Error fetching payment key: $e");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Prepare Payment Data Payload
|
||||||
|
final Map<String, dynamic> data = {
|
||||||
|
"source": {
|
||||||
|
"identifier": "01010101010", // Replace with actual source identifier
|
||||||
|
"subtype": "WALLET",
|
||||||
|
},
|
||||||
|
"payment_token": paymentToken,
|
||||||
|
};
|
||||||
|
|
||||||
|
// 3. Make Payment Request using Dio
|
||||||
|
final dio = Dio();
|
||||||
|
try {
|
||||||
|
final response = await dio.post(
|
||||||
|
'https://accept.paymob.com/api/acceptance/payments/pay',
|
||||||
|
data: data,
|
||||||
);
|
);
|
||||||
|
|
||||||
// String paymentStatus = await _getStatusAfterPaid();
|
// 4. Handle Payment Response
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
// Payment successful: Process response data (e.g., transaction ID)
|
||||||
|
final paymentData = response.data; // Assuming JSON response
|
||||||
|
print("Payment successful: $paymentData");
|
||||||
|
// Navigate to success screen or display success message
|
||||||
|
} else {
|
||||||
|
// Payment failed: Handle errors (e.g., display error message)
|
||||||
|
print("Payment failed: ${response.statusCode} - ${response.data}");
|
||||||
}
|
}
|
||||||
|
} on DioError catch (e) {
|
||||||
|
// Handle network or Dio-related errors
|
||||||
|
print("Error making payment request: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Future<void> payWithPayMob(int amount, String currency) async {
|
||||||
|
// String key = await PaymobManager().getPaymentKey(amount, currency);
|
||||||
|
// await launchUrl(Uri.parse(
|
||||||
|
// // 'https://accept.paymob.com/api/acceptance/iframes/837992?payment_token=$key'),
|
||||||
|
// 'https://accept.paymob.com/api/acceptance/payments/pay'));
|
||||||
|
// print(key);
|
||||||
|
// final dio.Response response = await Dio()
|
||||||
|
// .post('https://accept.paymob.com/api/acceptance/payments/pay', data: {
|
||||||
|
// "source": {
|
||||||
|
// "identifier": "01010101010",
|
||||||
|
// "subtype": "WALLET",
|
||||||
|
// },
|
||||||
|
// "payment_token": key, // token obtained in step 3
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// // String paymentStatus = await _getStatusAfterPaid();
|
||||||
|
// }
|
||||||
|
|
||||||
Future<String> _getStatusAfterPaid() async {
|
Future<String> _getStatusAfterPaid() async {
|
||||||
print(authanticationToken1);
|
print(authanticationToken1);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:SEFER/controller/functions/location_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
@@ -5,6 +6,7 @@ import 'package:SEFER/constant/style.dart';
|
|||||||
import 'package:SEFER/controller/auth/captin/history_captain.dart';
|
import 'package:SEFER/controller/auth/captin/history_captain.dart';
|
||||||
import 'package:SEFER/controller/functions/launch.dart';
|
import 'package:SEFER/controller/functions/launch.dart';
|
||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||||
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
|
||||||
import '../../../widgets/mycircular.dart';
|
import '../../../widgets/mycircular.dart';
|
||||||
|
|
||||||
@@ -20,11 +22,13 @@ class HistoryDetailsPage extends StatelessWidget {
|
|||||||
GetBuilder<HistoryCaptainController>(
|
GetBuilder<HistoryCaptainController>(
|
||||||
builder: (historyCaptainController) {
|
builder: (historyCaptainController) {
|
||||||
var res = historyCaptainController.historyDetailsData['data'];
|
var res = historyCaptainController.historyDetailsData['data'];
|
||||||
return Expanded(
|
return historyCaptainController.isloading
|
||||||
child: historyCaptainController.isloading
|
|
||||||
? const MyCircularProgressIndicator()
|
? const MyCircularProgressIndicator()
|
||||||
: SingleChildScrollView(
|
: SingleChildScrollView(
|
||||||
|
child: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: Get.width * .8,
|
width: Get.width * .8,
|
||||||
@@ -38,17 +42,58 @@ class HistoryDetailsPage extends StatelessWidget {
|
|||||||
print(mapUrl);
|
print(mapUrl);
|
||||||
showInBrowser(mapUrl);
|
showInBrowser(mapUrl);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Column(
|
||||||
'Trip on Map Click here'.tr,
|
children: [
|
||||||
style: AppStyle.title,
|
SizedBox(
|
||||||
|
height: Get.height * .2,
|
||||||
|
width: Get.width * .75,
|
||||||
|
child: GoogleMap(
|
||||||
|
initialCameraPosition: CameraPosition(
|
||||||
|
target: Get.find<LocationController>()
|
||||||
|
.myLocation, // Assuming passenger location is available
|
||||||
|
tilt: 80, zoom: 13,
|
||||||
),
|
),
|
||||||
|
zoomControlsEnabled: true,
|
||||||
|
// liteModeEnabled: true,
|
||||||
|
polylines: {
|
||||||
|
Polyline(
|
||||||
|
zIndex: 2,
|
||||||
|
consumeTapEvents: true,
|
||||||
|
geodesic: true,
|
||||||
|
endCap: Cap.buttCap,
|
||||||
|
startCap: Cap.buttCap,
|
||||||
|
visible: true,
|
||||||
|
polylineId: const PolylineId('route'),
|
||||||
|
points: [
|
||||||
|
LatLng(
|
||||||
|
double.parse(res['start_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[0]),
|
||||||
|
double.parse(res['start_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[1]),
|
||||||
|
),
|
||||||
|
LatLng(
|
||||||
|
double.parse(res['end_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[0]),
|
||||||
|
double.parse(res['end_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[1]),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${'Order ID'.tr} ${res['id']}',
|
'${'Order ID'.tr} ${res['id']}',
|
||||||
@@ -60,6 +105,10 @@ class HistoryDetailsPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
@@ -146,7 +195,8 @@ class HistoryDetailsPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
),
|
||||||
|
);
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
isleading: true,
|
isleading: true,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
import 'package:SEFER/controller/profile/setting_controller.dart';
|
import 'package:SEFER/controller/profile/setting_controller.dart';
|
||||||
|
import 'package:SEFER/views/home/profile/passenger_profile_page.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
@@ -25,13 +26,30 @@ class SettingsCaptain extends StatelessWidget {
|
|||||||
'Language'.tr,
|
'Language'.tr,
|
||||||
style: AppStyle.headTitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
subtitle: Text('ou can change the language of the app'.tr),
|
subtitle: Text('You can change the language of the app'.tr),
|
||||||
onTap: () => Get.to(const Language()),
|
onTap: () => Get.to(const Language()),
|
||||||
),
|
),
|
||||||
const Divider(
|
const Divider(
|
||||||
endIndent: 44,
|
endIndent: 44,
|
||||||
indent: 44,
|
indent: 44,
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.place_outlined),
|
||||||
|
title: Text(
|
||||||
|
'Change Country'.tr,
|
||||||
|
style: AppStyle.headTitle2,
|
||||||
|
),
|
||||||
|
subtitle:
|
||||||
|
Text('You can change the Country to get all features'.tr),
|
||||||
|
onTap: () => Get.to(MyScafolld(
|
||||||
|
title: 'Change Country'.tr,
|
||||||
|
body: [CountryPickerFromSetting()],
|
||||||
|
isleading: true)),
|
||||||
|
),
|
||||||
|
const Divider(
|
||||||
|
endIndent: 44,
|
||||||
|
indent: 44,
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(
|
leading: const Icon(
|
||||||
MaterialCommunityIcons.map_marker_radius,
|
MaterialCommunityIcons.map_marker_radius,
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import 'package:SEFER/constant/style.dart';
|
|||||||
import 'package:SEFER/views/lang/languages.dart';
|
import 'package:SEFER/views/lang/languages.dart';
|
||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
import 'profile/passenger_profile_page.dart';
|
||||||
|
|
||||||
class HomePage extends StatelessWidget {
|
class HomePage extends StatelessWidget {
|
||||||
const HomePage({super.key});
|
const HomePage({super.key});
|
||||||
|
|
||||||
@@ -16,36 +18,34 @@ class HomePage extends StatelessWidget {
|
|||||||
body: [
|
body: [
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
// padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||||
child: ListTile(
|
// child: ListTile(
|
||||||
title: Text(
|
// title: Text(
|
||||||
'Settings'.tr,
|
// 'Settings'.tr,
|
||||||
style: AppStyle.title,
|
// style: AppStyle.headTitle2,
|
||||||
),
|
// ),
|
||||||
subtitle: Text('To change some Settings'.tr),
|
// subtitle: Text('To change some Settings'.tr),
|
||||||
trailing: const Icon(
|
// trailing: const Icon(
|
||||||
Icons.arrow_forward_ios,
|
// Icons.arrow_forward_ios,
|
||||||
size: 30,
|
// size: 30,
|
||||||
color: AppColor.primaryColor,
|
// color: AppColor.primaryColor,
|
||||||
),
|
// ),
|
||||||
leading: const Icon(
|
// leading: const Icon(
|
||||||
Icons.settings,
|
// Icons.settings,
|
||||||
color: AppColor.primaryColor,
|
// color: AppColor.primaryColor,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Padding(
|
ListTile(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
|
||||||
child: ListTile(
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.to(() => const Language());
|
Get.to(() => const Language());
|
||||||
},
|
},
|
||||||
title: Text(
|
title: Text(
|
||||||
'Language'.tr,
|
'Language'.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
subtitle: Text('To change Languge the App'.tr),
|
subtitle: Text('To change Language the App'.tr),
|
||||||
trailing: const Icon(
|
trailing: const Icon(
|
||||||
Icons.arrow_forward_ios,
|
Icons.arrow_forward_ios,
|
||||||
size: 30,
|
size: 30,
|
||||||
@@ -56,7 +56,19 @@ class HomePage extends StatelessWidget {
|
|||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
ListTile(
|
||||||
|
leading: const Icon(Icons.place_outlined),
|
||||||
|
title: Text(
|
||||||
|
'Change Country'.tr,
|
||||||
|
style: AppStyle.headTitle2,
|
||||||
|
),
|
||||||
|
subtitle:
|
||||||
|
Text('You can change the Country to get all features'.tr),
|
||||||
|
onTap: () => Get.to(MyScafolld(
|
||||||
|
title: 'Change Country'.tr,
|
||||||
|
body: [CountryPickerFromSetting()],
|
||||||
|
isleading: true)),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
borderRadius: BorderRadius.circular(15)),
|
borderRadius: BorderRadius.circular(15)),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
// await PaymobManager().payWithPayMob(100, 'EGP');
|
await PaymobManager().payWithPayMob(100, 'EGP');
|
||||||
// await Get.find<PaymentController>()
|
// await Get.find<PaymentController>()
|
||||||
// .payWithPayMob(context, '1100', 'EGP');
|
// .payWithPayMob(context, '1100', 'EGP');
|
||||||
// Initiates a payment with a card using the FlutterPaymob instance
|
// Initiates a payment with a card using the FlutterPaymob instance
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ class CardSeferWallet extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<PaymentController>(builder: (paymentController) {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -110,7 +111,8 @@ class CardSeferWallet extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${box.read(BoxName.passengerWalletTotal)} \$' ?? '0.0 \$',
|
'${box.read(BoxName.passengerWalletTotal)} \$' ??
|
||||||
|
'0.0 \$',
|
||||||
style: AppStyle.headTitle2,
|
style: AppStyle.headTitle2,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -129,5 +131,6 @@ class CardSeferWallet extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class PassengerWalletDialoge extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
box.read(BoxName.countryCode) == 'Egypt'
|
box.read(BoxName.countryCode) == 'Egypt'
|
||||||
? '100 ${'LE'.tr}'.tr
|
? '100 ${'LE'.tr}'.tr
|
||||||
: '10\$ and get 3% discount',
|
: '10 ${'JOD'.tr}'.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -37,26 +37,29 @@ class OrderHistory extends StatelessWidget {
|
|||||||
itemCount: orderHistoryController
|
itemCount: orderHistoryController
|
||||||
.orderHistoryListPassenger.length,
|
.orderHistoryListPassenger.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
final rides = orderHistoryController
|
// Use integer index here
|
||||||
.orderHistoryListPassenger[index];
|
final rides =
|
||||||
|
orderHistoryController.orderHistoryListPassenger[
|
||||||
|
index]; // Access data using index
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
child: Padding(
|
child: InkWell(
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
String mapUrl =
|
String mapUrl =
|
||||||
'https://www.google.com/maps/dir/${rides['start_location']}/${rides['end_location']}/';
|
'https://www.google.com/maps/dir/${rides['start_location']}/${rides['end_location']}/';
|
||||||
// print(mapUrl);
|
// print(mapUrl);
|
||||||
showInBrowser(mapUrl);
|
showInBrowser(mapUrl);
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
height: Get.height * .2,
|
height: Get.height * .2,
|
||||||
width: Get.width * .75,
|
width: Get.width * .75,
|
||||||
child: GoogleMap(
|
child: GoogleMap(
|
||||||
@@ -66,6 +69,8 @@ class OrderHistory extends StatelessWidget {
|
|||||||
.passengerLocation, // Assuming passenger location is available
|
.passengerLocation, // Assuming passenger location is available
|
||||||
zoom: 15,
|
zoom: 15,
|
||||||
),
|
),
|
||||||
|
zoomControlsEnabled: true,
|
||||||
|
liteModeEnabled: true,
|
||||||
polylines: {
|
polylines: {
|
||||||
Polyline(
|
Polyline(
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
@@ -78,15 +83,25 @@ class OrderHistory extends StatelessWidget {
|
|||||||
const PolylineId('route'),
|
const PolylineId('route'),
|
||||||
points: [
|
points: [
|
||||||
LatLng(
|
LatLng(
|
||||||
|
double.parse(
|
||||||
rides['start_location']
|
rides['start_location']
|
||||||
['latitude'],
|
.toString()
|
||||||
|
.split(',')[0]),
|
||||||
|
double.parse(
|
||||||
rides['start_location']
|
rides['start_location']
|
||||||
['longitude']),
|
.toString()
|
||||||
|
.split(',')[1]),
|
||||||
|
),
|
||||||
LatLng(
|
LatLng(
|
||||||
|
double.parse(
|
||||||
rides['end_location']
|
rides['end_location']
|
||||||
['latitude'],
|
.toString()
|
||||||
|
.split(',')[0]),
|
||||||
|
double.parse(
|
||||||
rides['end_location']
|
rides['end_location']
|
||||||
['longitude']),
|
.toString()
|
||||||
|
.split(',')[1]),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
width: 5,
|
width: 5,
|
||||||
@@ -94,8 +109,9 @@ class OrderHistory extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
Column(
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
rides['date'],
|
rides['date'],
|
||||||
@@ -107,7 +123,8 @@ class OrderHistory extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
rides['status'],
|
rides['status'],
|
||||||
style: rides['status'] != 'Canceled'.tr
|
style: rides['status'] !=
|
||||||
|
'Canceled'.tr
|
||||||
? AppStyle.subtitle.copyWith(
|
? AppStyle.subtitle.copyWith(
|
||||||
color: AppColor.greenColor)
|
color: AppColor.greenColor)
|
||||||
: AppStyle.subtitle.copyWith(
|
: AppStyle.subtitle.copyWith(
|
||||||
@@ -123,6 +140,7 @@ class OrderHistory extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -363,8 +363,10 @@ class CountryPicker extends StatelessWidget {
|
|||||||
Get.find<LoginController>().saveCountryCode(controller
|
Get.find<LoginController>().saveCountryCode(controller
|
||||||
.selectedCountry
|
.selectedCountry
|
||||||
.toString()); // No conversion needed
|
.toString()); // No conversion needed
|
||||||
box.write(BoxName.countryCode,
|
box.write(
|
||||||
|
BoxName.countryCode, //
|
||||||
controller.selectedCountry); // Already saved in English
|
controller.selectedCountry); // Already saved in English
|
||||||
|
Get.snackbar(controller.selectedCountry.toString().tr, '');
|
||||||
Get.off(LoginPage());
|
Get.off(LoginPage());
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -373,3 +375,80 @@ class CountryPicker extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CountryPickerFromSetting extends StatelessWidget {
|
||||||
|
final ProfileController controller = Get.put(ProfileController());
|
||||||
|
final LoginController loginController = Get.put(LoginController());
|
||||||
|
|
||||||
|
final List<String> countryOptions = [
|
||||||
|
'Jordan',
|
||||||
|
'USA',
|
||||||
|
'Egypt',
|
||||||
|
'Turkey',
|
||||||
|
'Saudi Arabia',
|
||||||
|
'Qatar',
|
||||||
|
'Bahrain',
|
||||||
|
'Kuwait',
|
||||||
|
];
|
||||||
|
|
||||||
|
CountryPickerFromSetting({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<ProfileController>(builder: (controller) {
|
||||||
|
return ListView(
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Text("Select Your Country".tr),
|
||||||
|
// const SizedBox(
|
||||||
|
// height: 20,
|
||||||
|
// ),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
child: Text(
|
||||||
|
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
|
||||||
|
.tr),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 200,
|
||||||
|
child: CupertinoPicker(
|
||||||
|
itemExtent: 32,
|
||||||
|
onSelectedItemChanged: (int index) {
|
||||||
|
controller.setCountry(countryOptions[index]);
|
||||||
|
box.write(BoxName.countryCode,
|
||||||
|
countryOptions[index]); // Save in English
|
||||||
|
},
|
||||||
|
children: List.generate(
|
||||||
|
countryOptions.length,
|
||||||
|
(index) => Center(
|
||||||
|
child: Text(
|
||||||
|
countryOptions[index]
|
||||||
|
.tr, // Display translated if not English
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Select Country'.tr, // Use translated text for button
|
||||||
|
onPressed: () async {
|
||||||
|
loginController.saveCountryCode(controller.selectedCountry
|
||||||
|
.toString()); // No conversion needed
|
||||||
|
box.write(
|
||||||
|
BoxName.countryCode, //
|
||||||
|
controller.selectedCountry); // Already saved in English
|
||||||
|
Get.snackbar(controller.selectedCountry.toString().tr, '',
|
||||||
|
backgroundColor: AppColor.greenColor);
|
||||||
|
// Get.back();//
|
||||||
|
// Get.back();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user