3/1/1
This commit is contained in:
@@ -26,6 +26,6 @@ class PassengerLocationMapPage extends StatelessWidget {
|
||||
const SosConnect(),
|
||||
const GoogleMapApp(),
|
||||
],
|
||||
isleading: true);
|
||||
isleading: false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
import 'package:SEFER/constant/api_key.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
@@ -11,9 +20,17 @@ import 'package:SEFER/views/home/my_wallet/walet_captain.dart';
|
||||
import 'package:SEFER/views/home/profile/profile_captain.dart';
|
||||
import 'package:SEFER/views/notification/notification_captain.dart';
|
||||
|
||||
import '../../../../controller/functions/upload_image.dart';
|
||||
|
||||
class DrawerCaptain extends StatelessWidget {
|
||||
ImageController imageController = Get.put(ImageController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String writeText(int times) {
|
||||
return '*' * times;
|
||||
}
|
||||
|
||||
return Drawer(
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -24,18 +41,84 @@ class DrawerCaptain extends StatelessWidget {
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColor.greenColor,
|
||||
AppColor.yellowColor
|
||||
], // Define your gradient colors
|
||||
AppColor.yellowColor,
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
),
|
||||
accountName: Text(box.read(BoxName.nameDriver)),
|
||||
accountEmail: Text(box.read(BoxName.emailDriver)),
|
||||
currentAccountPicture: const CircleAvatar(
|
||||
backgroundImage: AssetImage('path_to_profile_image'),
|
||||
), //todo image from server
|
||||
currentAccountPictureSize: const Size.square(100),
|
||||
arrowColor: AppColor.deepPurpleAccent,
|
||||
accountName: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
box.read(BoxName.nameDriver),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const Spacer(),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
Get.find<HomeCaptainController>().rating,
|
||||
style: AppStyle.number.copyWith(color: Colors.amber),
|
||||
),
|
||||
Container(
|
||||
// width: Get.width * .4,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4, vertical: 1),
|
||||
color: AppColor.greenColor,
|
||||
child: RatingBar.builder(
|
||||
initialRating: double.parse(
|
||||
Get.find<HomeCaptainController>().rating),
|
||||
minRating: 1,
|
||||
direction: Axis.horizontal,
|
||||
itemCount: 5,
|
||||
itemSize: 20,
|
||||
itemPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 2),
|
||||
itemBuilder: (context, _) => const Icon(
|
||||
Icons.star,
|
||||
color: Colors.amber,
|
||||
),
|
||||
onRatingUpdate: (rating) {}),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
accountEmail: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Text(
|
||||
box.read(BoxName.emailDriver),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
currentAccountPicture: Stack(
|
||||
children: [
|
||||
GetBuilder<ImageController>(builder: (imageController) {
|
||||
return imageController.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: ClipOval(
|
||||
child: Image.network(
|
||||
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg'));
|
||||
}),
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 0,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
imageController.choosImage(AppLink.uploadImage1);
|
||||
},
|
||||
icon: const Icon(Icons.edit),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
ListTile(
|
||||
leading: const Icon(Icons.account_balance_wallet),
|
||||
title: Text('Wallet'.tr),
|
||||
|
||||
@@ -27,7 +27,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(OrderRequestController());
|
||||
|
||||
Get.put(HomeCaptainController());
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColor.greenColor,
|
||||
@@ -135,7 +135,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
@@ -156,15 +156,19 @@ class HomeCaptain extends StatelessWidget {
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
color: AppColor.greenColor,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8, vertical: 2),
|
||||
child: Text(
|
||||
'Ride Today :'.tr +
|
||||
'Ride Today : '.tr +
|
||||
Get.find<HomeCaptainController>()
|
||||
.countRideToday,
|
||||
style: AppStyle.title,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.secondaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -16,6 +16,7 @@ class GoogleDriverMap extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Get.put(MapDriverController());
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GetBuilder<MapDriverController>(
|
||||
@@ -24,11 +25,12 @@ class GoogleDriverMap extends StatelessWidget {
|
||||
initialCameraPosition: CameraPosition(
|
||||
// bearing: 45,
|
||||
target: locationController.myLocation,
|
||||
zoom: 15,
|
||||
zoom: 16,
|
||||
tilt: 40,
|
||||
),
|
||||
onCameraMoveStarted: () {},
|
||||
onCameraMove: (position) {
|
||||
locationController.myLocation = position.target;
|
||||
// locationController.myLocation = position.target;
|
||||
print(position);
|
||||
},
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:SEFER/controller/functions/location_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
@@ -8,10 +10,12 @@ import 'package:SEFER/controller/firebase/firbase_messge.dart';
|
||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/functions/launch.dart';
|
||||
import '../../../../controller/home/captin/widget/call_page.dart';
|
||||
import 'google_map_app.dart';
|
||||
|
||||
class PassengerInfoWindow extends StatelessWidget {
|
||||
const PassengerInfoWindow({
|
||||
@@ -87,6 +91,24 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
Icons.email,
|
||||
color: AppColor.redColor,
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 25,
|
||||
),
|
||||
Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.openGoogleMapFromDriverToPassenger();
|
||||
},
|
||||
icon: const Icon(
|
||||
MaterialCommunityIcons
|
||||
.map_marker_radius,
|
||||
size: 35,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -165,7 +187,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 50,
|
||||
minHeight: 35,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: controller.progressToPassenger
|
||||
.toDouble(),
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/controller/profile/setting_controller.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/lang/languages.dart';
|
||||
@@ -9,6 +13,7 @@ class SettingsCaptain extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(SettingController());
|
||||
return MyScafolld(
|
||||
title: 'Settings'.tr,
|
||||
body: [
|
||||
@@ -20,14 +25,39 @@ class SettingsCaptain extends StatelessWidget {
|
||||
'Language'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text('you can change languge of app'.tr),
|
||||
onTap: () => Get.to(const Language()),
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const Icon(Icons.notifications),
|
||||
// title: const Text('Notifications'),
|
||||
// onTap: () =>
|
||||
// Navigator.pushNamed(context, '/notification-settings'),
|
||||
// ),
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
MaterialCommunityIcons.map_marker_radius,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
title: Text(
|
||||
'Google Map App'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'If you want to make Google Map App run dirctly when you apply order'
|
||||
.tr),
|
||||
trailing:
|
||||
GetBuilder<SettingController>(builder: (settingController) {
|
||||
return CupertinoSwitch(
|
||||
value: settingController.isGoogleMapsEnabled,
|
||||
onChanged: (bool value) {
|
||||
settingController.onChangMapApp();
|
||||
},
|
||||
);
|
||||
}),
|
||||
),
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const Icon(Icons.account_circle),
|
||||
// title: const Text('Account'),
|
||||
|
||||
@@ -14,476 +14,496 @@ import '../../../controller/home/map_passenger_controller.dart';
|
||||
GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
Get.put(PaymentController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) =>
|
||||
controller.isBottomSheetShown && controller.rideConfirm == false
|
||||
? Positioned(
|
||||
left: 5,
|
||||
bottom: 0,
|
||||
right: 5,
|
||||
child: Column(
|
||||
builder: (controller) => controller.isBottomSheetShown &&
|
||||
controller.rideConfirm == false
|
||||
? Positioned(
|
||||
left: 5,
|
||||
bottom: 0,
|
||||
right: 5,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
double.parse(box.read(BoxName.passengerWalletTotal)) <
|
||||
0 &&
|
||||
controller.data.isNotEmpty
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration.copyWith(
|
||||
color: AppColor.redColor.withOpacity(.5)),
|
||||
height: 50,
|
||||
width: Get.width * .94,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8),
|
||||
child: Text(
|
||||
'Your trip cost is'.tr +
|
||||
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||
'But you have a negative salary of'
|
||||
.tr +
|
||||
'${double.parse(box.read(BoxName.passengerWalletTotal)).toStringAsFixed(2)}'
|
||||
' in your'
|
||||
.tr +
|
||||
' ${AppInformation.appName}'
|
||||
' wallet due to a previous trip.'
|
||||
.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
))
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
curve: Curves.easeInCirc,
|
||||
onEnd: () {
|
||||
controller.height = 250;
|
||||
},
|
||||
height: controller.heightBottomSheetShown,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Column(
|
||||
children: [
|
||||
controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Container(
|
||||
// width: Get.width * .9,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor
|
||||
.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .15,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/jeep.png',
|
||||
width: 50,
|
||||
fit: BoxFit.fill,
|
||||
repeat: ImageRepeat.repeatX,
|
||||
double.parse(box.read(BoxName.passengerWalletTotal)) <
|
||||
0 &&
|
||||
controller.data.isNotEmpty
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration.copyWith(
|
||||
color: AppColor.redColor.withOpacity(.5)),
|
||||
height: 50,
|
||||
width: Get.width * .94,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(
|
||||
'Your trip cost is'.tr +
|
||||
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||
'But you have a negative salary of'
|
||||
.tr +
|
||||
'${double.parse(box.read(BoxName.passengerWalletTotal)).toStringAsFixed(2)}'
|
||||
' in your'
|
||||
.tr +
|
||||
' ${AppInformation.appName}'
|
||||
' wallet due to a previous trip.'
|
||||
.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
))
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
curve: Curves.easeInCirc,
|
||||
onEnd: () {
|
||||
controller.height = 250;
|
||||
},
|
||||
height: controller.heightBottomSheetShown,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Column(
|
||||
children: [
|
||||
controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Container(
|
||||
// width: Get.width * .9,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor
|
||||
.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: controller
|
||||
.dataCarsLocationByPassenger.length,
|
||||
itemBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return Container(
|
||||
color: controller.gender == 'Female'
|
||||
? const Color.fromARGB(
|
||||
255, 246, 52, 181)
|
||||
: AppColor.secondaryColor,
|
||||
width: Get.width,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .15,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/jeep.png',
|
||||
width: 50,
|
||||
fit: BoxFit.fill,
|
||||
repeat: ImageRepeat.repeatX,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .55,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
controller.hours > 1
|
||||
? '${'Your Ride Duration is '.tr}${controller.hours} H and ${controller.minutes} m'
|
||||
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
// Text(
|
||||
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
Text(
|
||||
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 5, left: 5),
|
||||
SizedBox(
|
||||
width: Get.width * .55,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .14,
|
||||
height: Get.height * .06,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: AppColor
|
||||
.greenColor)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.promoTaken
|
||||
? const Icon(
|
||||
Icons
|
||||
.filter_vintage_rounded,
|
||||
color:
|
||||
AppColor.redColor,
|
||||
)
|
||||
: const SizedBox(
|
||||
height: 0,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Container(
|
||||
// height: 130,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor
|
||||
.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
child: controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.location_on,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'From : '.tr,
|
||||
controller.hours > 1
|
||||
? '${'Your Ride Duration is '.tr}${controller.hours} H and ${controller.minutes} m'
|
||||
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
// Text(
|
||||
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
Text(
|
||||
controller.data[0]
|
||||
['start_address']
|
||||
.toString(),
|
||||
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons
|
||||
.location_searching_rounded),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'To : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]
|
||||
['end_address'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: AppColor.accentColor,
|
||||
thickness: 1,
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 5, left: 5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .14,
|
||||
height: Get.height * .06,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12),
|
||||
// border: Border.all(),
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
shape:
|
||||
BoxShape.rectangle,
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: AppColor
|
||||
.greenColor)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||
style:
|
||||
AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.monetization_on,
|
||||
),
|
||||
controller.promoTaken
|
||||
? const Icon(
|
||||
Icons
|
||||
.filter_vintage_rounded,
|
||||
color:
|
||||
Colors.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
Get.find<
|
||||
PaymentController>()
|
||||
.getPassengerWallet();
|
||||
},
|
||||
child: GetBuilder<
|
||||
PaymentController>(
|
||||
builder: (paymentController) =>
|
||||
paymentController
|
||||
.isCashChecked
|
||||
? Text(
|
||||
'CASH',
|
||||
style: AppStyle
|
||||
.title,
|
||||
)
|
||||
: Text(
|
||||
'${AppInformation.appName} Wallet',
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
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:
|
||||
() {
|
||||
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,
|
||||
),
|
||||
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 {
|
||||
controller.applyPromoCodeToPassenger();
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'You have promo!'.tr,
|
||||
'',
|
||||
backgroundColor: AppColor.redColor);
|
||||
}
|
||||
},
|
||||
child:
|
||||
Text(
|
||||
'Add Promo'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
AppColor.redColor,
|
||||
)
|
||||
: const SizedBox(
|
||||
height: 0,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .95,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
controller.isCashSelectedBeforeConfirmRide ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
},
|
||||
)
|
||||
: controller.isPassengerChosen ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.onChangedPassengersChoose();
|
||||
Get.defaultDialog(
|
||||
barrierDismissible:
|
||||
false,
|
||||
title:
|
||||
'How Many Passengers?'
|
||||
.tr,
|
||||
titleStyle:
|
||||
AppStyle
|
||||
.title,
|
||||
content:
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'Allowed up to 4 Passengers.'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
SizedBox(
|
||||
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(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
: MyElevatedButton(
|
||||
title:
|
||||
'Confirm Selection'
|
||||
.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeConfirmRide();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Container(
|
||||
// height: 130,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(15))),
|
||||
child: controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.location_on,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'From : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]
|
||||
['start_address']
|
||||
.toString(),
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons
|
||||
.location_searching_rounded),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'To : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]['end_address'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: AppColor.accentColor,
|
||||
thickness: 1,
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
AppColor.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(12),
|
||||
// border: Border.all(),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.monetization_on,
|
||||
color: Colors.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
Get.find<
|
||||
PaymentController>()
|
||||
.getPassengerWallet();
|
||||
},
|
||||
child: GetBuilder<
|
||||
PaymentController>(
|
||||
builder: (paymentController) =>
|
||||
paymentController
|
||||
.isCashChecked
|
||||
? Text(
|
||||
'CASH',
|
||||
style: AppStyle
|
||||
.title,
|
||||
)
|
||||
: Text(
|
||||
'${AppInformation.appName} Wallet',
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
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: () {
|
||||
if (controller
|
||||
.promoTaken ==
|
||||
false) {
|
||||
Get.defaultDialog(
|
||||
title: 'Add Promo'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .7,
|
||||
child: TextFormField(
|
||||
controller: controller.promo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Promo Code'.tr,
|
||||
hintText: 'Enter promo code'.tr,
|
||||
labelStyle: AppStyle.subtitle,
|
||||
hintStyle: AppStyle.subtitle,
|
||||
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 {
|
||||
controller.applyPromoCodeToPassenger();
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'You have promo!'
|
||||
.tr,
|
||||
'',
|
||||
backgroundColor:
|
||||
AppColor.redColor);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Add Promo'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .95,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
controller.isCashSelectedBeforeConfirmRide ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
},
|
||||
)
|
||||
:
|
||||
// controller.isPassengerChosen ==
|
||||
// false
|
||||
// ? MyElevatedButton(
|
||||
// title: 'Next'.tr,
|
||||
// onPressed: () {
|
||||
// controller
|
||||
// .onChangedPassengersChoose();
|
||||
// Get.defaultDialog(
|
||||
// barrierDismissible:
|
||||
// false,
|
||||
// title:
|
||||
// 'How Many Passengers?'
|
||||
// .tr,
|
||||
// titleStyle:
|
||||
// AppStyle
|
||||
// .title,
|
||||
// content:
|
||||
// Column(
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Allowed up to 4 Passengers.'
|
||||
// .tr,
|
||||
// style: AppStyle
|
||||
// .title,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// 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(),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// )
|
||||
// :
|
||||
MyElevatedButton(
|
||||
title: 'Confirm Selection'
|
||||
.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeConfirmRide();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox());
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox());
|
||||
}
|
||||
|
||||
class Details extends StatelessWidget {
|
||||
|
||||
@@ -9,9 +9,9 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: ((controller) => controller.rideConfirm
|
||||
? Positioned(
|
||||
top: Get.height * .2,
|
||||
left: Get.width * .2,
|
||||
right: Get.width * .2,
|
||||
top: Get.height * .1,
|
||||
left: Get.width * .1,
|
||||
right: Get.width * .1,
|
||||
child: ClipPath(
|
||||
clipper:
|
||||
HexagonClipper(), // CustomClipper to create a hexagon shape
|
||||
@@ -19,7 +19,7 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
duration: const Duration(microseconds: 300),
|
||||
height: 250,
|
||||
width: 250,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
// gradient: const LinearGradient(
|
||||
// colors: [AppColor.greenColor, AppColor.secondaryColor],
|
||||
// begin: Alignment.topLeft,
|
||||
@@ -80,12 +80,6 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
// Text(
|
||||
// controller.dataCarsLocationByPassenger['message']
|
||||
// [controller.carsOrder]['seats']
|
||||
// .toString(),
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
@@ -95,6 +89,15 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(border: Border.all(width: 2)),
|
||||
child: Text(
|
||||
controller.dataCarsLocationByPassenger['message']
|
||||
[controller.carsOrder]['car_plate']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -19,7 +19,7 @@ GetBuilder<MapPassengerController> formSearchPlacesStart() {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .8,
|
||||
width: Get.width * .75,
|
||||
height: 40,
|
||||
decoration:
|
||||
const BoxDecoration(color: AppColor.secondaryColor),
|
||||
|
||||
@@ -61,27 +61,30 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
if (Platform.isIOS)
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
controller.mapController?.animateCamera(
|
||||
CameraUpdate.newLatLng(LatLng(
|
||||
controller.passengerLocation.latitude,
|
||||
controller.passengerLocation.longitude)));
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.location_on,
|
||||
size: 29,
|
||||
),
|
||||
// if (Platform.isIOS)
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
controller.mapController?.animateCamera(
|
||||
CameraUpdate.newLatLng(LatLng(
|
||||
controller.passengerLocation.latitude,
|
||||
controller.passengerLocation.longitude)));
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.location_on,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
@@ -118,6 +121,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
// remoteID: '',
|
||||
// )
|
||||
// Get.to(() => const CallPage());
|
||||
print(box.read(BoxName.lang));
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.call,
|
||||
|
||||
@@ -130,6 +130,11 @@ class TimerToPassengerFromDriver extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Please go to Car now '.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
@@ -6,6 +7,8 @@ import 'package:SEFER/controller/functions/toast.dart';
|
||||
import 'package:SEFER/controller/payment/payment_controller.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../main.dart';
|
||||
|
||||
class PassengerWalletDialoge extends StatelessWidget {
|
||||
const PassengerWalletDialoge({
|
||||
super.key,
|
||||
@@ -145,9 +148,9 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
controller.makePaymentStripe(
|
||||
controller.selectedAmount!
|
||||
.toDouble(), // Convert int to double
|
||||
// 'EGP', () {
|
||||
// 'USD', () {
|
||||
'JOD', () {
|
||||
box.read(BoxName.countryCode) == 'Jordan'.tr
|
||||
? 'USD'
|
||||
: 'EGP', () {
|
||||
controller.addPassengerWallet();
|
||||
controller.changePromoSheetDialogue();
|
||||
controller.getPassengerWallet();
|
||||
|
||||
@@ -51,11 +51,24 @@ class WaletCaptain extends StatelessWidget {
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
|
||||
style: AppStyle.headTitle2,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.snackbar(
|
||||
'the 500 points equal 30 JOD'.tr,
|
||||
'the 500 points equal 30 JOD for you \nSo go and gain your money'
|
||||
.tr,
|
||||
backgroundColor: AppColor.greenColor,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
duration: const Duration(seconds: 4),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:SEFER/views/auth/login_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -11,6 +12,7 @@ import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../controller/auth/login_controller.dart';
|
||||
import '../../../controller/functions/log_out.dart';
|
||||
|
||||
class PassengerProfilePage extends StatelessWidget {
|
||||
@@ -317,33 +319,51 @@ class CountryPicker extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 300,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32,
|
||||
onSelectedItemChanged: (int index) {
|
||||
controller.setCountry(countryOptions[index]);
|
||||
},
|
||||
children: List.generate(
|
||||
countryOptions.length,
|
||||
(index) => Center(
|
||||
child: Text(
|
||||
countryOptions[index],
|
||||
style: AppStyle.title,
|
||||
return GetBuilder<ProfileController>(builder: (controller) {
|
||||
return Column(
|
||||
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: 300,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32,
|
||||
onSelectedItemChanged: (int index) {
|
||||
controller.setCountry(countryOptions[index]);
|
||||
},
|
||||
children: List.generate(
|
||||
countryOptions.length,
|
||||
(index) => Center(
|
||||
child: Text(
|
||||
countryOptions[index],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: controller.selectedCountry.toString(),
|
||||
onPressed: () {
|
||||
box.write(
|
||||
BoxName.countryCode, controller.selectedCountry.toString());
|
||||
})
|
||||
],
|
||||
);
|
||||
MyElevatedButton(
|
||||
title: 'Select Country'.tr,
|
||||
onPressed: () {
|
||||
Get.find<LoginController>()
|
||||
.saveCountryCode(controller.selectedCountry.toString());
|
||||
box.write(
|
||||
BoxName.countryCode, controller.selectedCountry.toString());
|
||||
Get.off(LoginPage());
|
||||
})
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../../constant/api_key.dart';
|
||||
import '../../widgets/my_textField.dart';
|
||||
|
||||
class ProfileCaptain extends StatelessWidget {
|
||||
@@ -32,7 +33,7 @@ class ProfileCaptain extends StatelessWidget {
|
||||
radius: Get.width * 0.26,
|
||||
backgroundColor: Colors.white,
|
||||
backgroundImage: CachedNetworkImageProvider(
|
||||
"${Env.serverPHP}/card_image/${box.read(BoxName.driverID)}.jpg",
|
||||
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg',
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
|
||||
Reference in New Issue
Block a user