5/29/5
This commit is contained in:
@@ -2,8 +2,9 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class AppColor {
|
class AppColor {
|
||||||
static const Color primaryColor = Colors.black; // Slightly softer red
|
static const Color primaryColor = Colors.black; // Slightly softer red
|
||||||
static const Color secondaryColor = Colors.white;
|
static const Color secondaryColor = Color.fromARGB(255, 255, 255, 255);
|
||||||
static const Color accentColor = Color(0xFFD81F26); // Google Green
|
static const Color accentColor =
|
||||||
|
Color.fromARGB(255, 185, 169, 169); // Google Green
|
||||||
static const Color backgroundColor =
|
static const Color backgroundColor =
|
||||||
Color(0xFFF5F5F5); // Light grey background
|
Color(0xFFF5F5F5); // Light grey background
|
||||||
static const Color redColor = Color(0xFFEA4335); // Google Red
|
static const Color redColor = Color(0xFFEA4335); // Google Red
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ class RegisterCaptainController extends GetxController {
|
|||||||
'token_code': randomNumber.toString(),
|
'token_code': randomNumber.toString(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// await smsEgyptController.sendSmsEgypt(
|
await smsEgyptController.sendSmsEgypt(
|
||||||
// phoneController.text.toString(), randomNumber.toString());
|
phoneController.text.toString(), randomNumber.toString());
|
||||||
isSent = true;
|
isSent = true;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ class SmsEgyptController extends GetxController {
|
|||||||
Future<dynamic> sendSmsEgypt(String phone, otp) async {
|
Future<dynamic> sendSmsEgypt(String phone, otp) async {
|
||||||
var body = jsonEncode({
|
var body = jsonEncode({
|
||||||
"username": AppInformation.appName,
|
"username": AppInformation.appName,
|
||||||
"password": 'E)Pu=an/@Z', // AK.smsPasswordEgypt,
|
"password": AK.smsPasswordEgypt, //'E)Pu=an/@Z',
|
||||||
"message": "${AppInformation.appName} app code is $otp\ncopy it to app",
|
"message": "${AppInformation.appName} app code is $otp\ncopy it to app",
|
||||||
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
|
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
|
||||||
"sender": "Kazumi", // todo add sefer sender name
|
"sender": "Sefer", // todo add sefer sender name
|
||||||
"receiver": "2$phone"
|
"receiver": "2$phone"
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ class SmsEgyptController extends GetxController {
|
|||||||
"password": AK.smsPasswordEgypt,
|
"password": AK.smsPasswordEgypt,
|
||||||
"message": "This is an example SMS message.",
|
"message": "This is an example SMS message.",
|
||||||
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
|
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
|
||||||
"sender": "Kazumi", // todo add sefer sender name
|
"sender": "Sefer", //"Kazumi", // todo add sefer sender name
|
||||||
"receiver": "2$phone",
|
"receiver": "2$phone",
|
||||||
"validity": "10",
|
"validity": "10",
|
||||||
"StartTime": DateTime.now().toString() // "1/1/2024 10:00:00"
|
"StartTime": DateTime.now().toString() // "1/1/2024 10:00:00"
|
||||||
|
|||||||
@@ -387,9 +387,10 @@ class MapDriverController extends GetxController {
|
|||||||
Get.back();
|
Get.back();
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
double costOfWaiting5Minute =
|
double costOfWaiting5Minute = box.read(BoxName.countryCode) == 'Egypt'
|
||||||
(distanceBetweenDriverAndPassengerWhenConfirm * .08) +
|
? (distanceBetweenDriverAndPassengerWhenConfirm * .08) + (5 * 1)
|
||||||
(5 * 1); //for Eygpt other like jordan .06 per minute
|
: (distanceBetweenDriverAndPassengerWhenConfirm * .06) +
|
||||||
|
(5 * .06); //for Eygpt other like jordan .06 per minute
|
||||||
var res = await CRUD().post(link: AppLink.addDriverpayment, payload: {
|
var res = await CRUD().post(link: AppLink.addDriverpayment, payload: {
|
||||||
'rideId': rideId,
|
'rideId': rideId,
|
||||||
'amount': costOfWaiting5Minute.toString(),
|
'amount': costOfWaiting5Minute.toString(),
|
||||||
@@ -516,6 +517,7 @@ class MapDriverController extends GetxController {
|
|||||||
'price': price.toString(),
|
'price': price.toString(),
|
||||||
});
|
});
|
||||||
// Get.back();
|
// Get.back();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancelCheckRideFromPassenger() async {
|
void cancelCheckRideFromPassenger() async {
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ class MyTranslation extends Translations {
|
|||||||
@override
|
@override
|
||||||
Map<String, Map<String, String>> get keys => {
|
Map<String, Map<String, String>> get keys => {
|
||||||
"ar": {
|
"ar": {
|
||||||
|
"Total price from ": "إجمالي السعر من ",
|
||||||
|
"Wallet Add": "إضافة إلى المحفظة",
|
||||||
|
"Press here": "اضغط هنا",
|
||||||
|
"Would the passenger like to settle the remaining fare using their wallet?":
|
||||||
|
"هل يرغب الراكب بسداد باقي الأجرة باستخدام محفظته؟",
|
||||||
|
"How much Passenger pay?": "كم يدفع الراكب؟",
|
||||||
|
"passenger amount to me": "مبلغ الراكب لي",
|
||||||
"Please wait": "الرجاء الانتظار",
|
"Please wait": "الرجاء الانتظار",
|
||||||
"minutes before trying again.": " دقيقة قبل المحاولة مرة أخرى.",
|
"minutes before trying again.": " دقيقة قبل المحاولة مرة أخرى.",
|
||||||
"Total rides on month": "إجمالي الرحلات في الشهر",
|
"Total rides on month": "إجمالي الرحلات في الشهر",
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|||||||
class RateController extends GetxController {
|
class RateController extends GetxController {
|
||||||
double selectedRateItemId = -1;
|
double selectedRateItemId = -1;
|
||||||
TextEditingController comment = TextEditingController();
|
TextEditingController comment = TextEditingController();
|
||||||
|
TextEditingController passenggerPayAmount = TextEditingController();
|
||||||
String? rideId, passengerId, driverId, price;
|
String? rideId, passengerId, driverId, price;
|
||||||
late GlobalKey<FormState> formKey;
|
late GlobalKey<FormState> formKey;
|
||||||
|
bool ispassengerWantWalletFromDriver = false;
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
formKey = GlobalKey<FormState>();
|
formKey = GlobalKey<FormState>();
|
||||||
@@ -27,6 +29,28 @@ class RateController extends GetxController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void passengerWantPay() {
|
||||||
|
ispassengerWantWalletFromDriver = true;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future addPassengerWallet() async {
|
||||||
|
if (formKey.currentState!.validate()) {
|
||||||
|
var priceOfTrip =
|
||||||
|
double.parse(Get.find<MapDriverController>().paymentAmount);
|
||||||
|
double remainingFee =
|
||||||
|
double.parse(passenggerPayAmount.text) - priceOfTrip;
|
||||||
|
await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||||
|
'passenger_id': passengerId,
|
||||||
|
'balance': remainingFee.toString()
|
||||||
|
}).then((value) {
|
||||||
|
if (value != 'failure') {
|
||||||
|
Get.snackbar('Wallet Add', '');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void selectRateItem(double id) {
|
void selectRateItem(double id) {
|
||||||
selectedRateItemId = id;
|
selectedRateItemId = id;
|
||||||
update();
|
update();
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||||
|
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
@@ -91,6 +93,59 @@ class RatePassenger extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
controller.ispassengerWantWalletFromDriver
|
||||||
|
? Container(
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"How much Passenger pay?".tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Form(
|
||||||
|
key: controller.formKey,
|
||||||
|
child: MyTextForm(
|
||||||
|
controller:
|
||||||
|
controller.passenggerPayAmount,
|
||||||
|
label: "passenger amount to me".tr,
|
||||||
|
hint: "passenger amount to me".tr,
|
||||||
|
type:
|
||||||
|
const TextInputType.numberWithOptions(
|
||||||
|
decimal: true)),
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: "Press here".tr,
|
||||||
|
onPressed: () {
|
||||||
|
controller.addPassengerWallet();
|
||||||
|
})
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
width: Get.width * .73,
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Would the passenger like to settle the remaining fare using their wallet?"
|
||||||
|
.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: "Press here".tr,
|
||||||
|
onPressed: () {
|
||||||
|
controller.passengerWantPay();
|
||||||
|
})
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
Center(
|
Center(
|
||||||
child: RatingBar.builder(
|
child: RatingBar.builder(
|
||||||
initialRating: 0,
|
initialRating: 0,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import 'package:SEFER/constant/links.dart';
|
|||||||
import 'package:SEFER/constant/style.dart';
|
import 'package:SEFER/constant/style.dart';
|
||||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:SEFER/views/notification/available_rides_page.dart';
|
import 'package:SEFER/views/notification/available_rides_page.dart';
|
||||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -25,198 +24,182 @@ class DrawerCaptain extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
String writeText(int times) {
|
|
||||||
return '*' * times;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
children: [
|
children: [
|
||||||
// Other drawer items
|
const UserAccountHeader(),
|
||||||
UserAccountsDrawerHeader(
|
_buildDivider(),
|
||||||
decoration: const BoxDecoration(
|
_buildDrawerItem(
|
||||||
color: AppColor.greenColor,
|
icon: Icons.account_balance_wallet,
|
||||||
gradient: LinearGradient(
|
text: 'Wallet'.tr,
|
||||||
colors: [
|
onTap: () =>
|
||||||
AppColor.primaryColor,
|
Get.to(() => WalletCaptain(), transition: Transition.native),
|
||||||
AppColor.secondaryColor,
|
|
||||||
],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
currentAccountPictureSize: const Size.square(100),
|
|
||||||
arrowColor: AppColor.deepPurpleAccent,
|
|
||||||
accountName: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
box.read(BoxName.nameDriver).toString(),
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
Get.find<HomeCaptainController>().rating.toString(),
|
|
||||||
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: 5,
|
|
||||||
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()
|
|
||||||
: CircleAvatar(
|
|
||||||
radius: 45,
|
|
||||||
backgroundImage: NetworkImage(
|
|
||||||
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg'),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
Positioned(
|
|
||||||
right: 0,
|
|
||||||
top: 0,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
imageController.choosImage(
|
|
||||||
AppLink.uploadImage1, 'portrait');
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.edit),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
_buildDivider(),
|
||||||
ListTile(
|
_buildDrawerItem(
|
||||||
leading: const Icon(Icons.account_balance_wallet),
|
icon: Icons.person,
|
||||||
title: Text(
|
text: 'Profile'.tr,
|
||||||
'Wallet'.tr,
|
onTap: () => Get.to(() => const ProfileCaptain(),
|
||||||
style: AppStyle.title,
|
transition: Transition.rightToLeftWithFade),
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
// Handle wallet item tap
|
|
||||||
Get.to(() => WalletCaptain(), transition: Transition.native);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
ListTile(
|
_buildDivider(),
|
||||||
leading: const Icon(Icons.person),
|
_buildDrawerItem(
|
||||||
title: Text(
|
icon: Icons.history,
|
||||||
'Profile'.tr,
|
text: 'History of Trip'.tr,
|
||||||
style: AppStyle.title,
|
onTap: () => Get.to(() => const HistoryCaptain(),
|
||||||
),
|
transition: Transition.downToUp),
|
||||||
onTap: () {
|
|
||||||
// Handle profile item tap
|
|
||||||
Get.to(() => const ProfileCaptain(),
|
|
||||||
transition: Transition.rightToLeftWithFade);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
ListTile(
|
_buildDivider(),
|
||||||
leading: const Icon(
|
_buildDrawerItem(
|
||||||
Icons.history,
|
icon: Icons.phonelink_ring_rounded,
|
||||||
),
|
text: 'Available for rides'.tr,
|
||||||
title: Text(
|
onTap: () => Get.to(() => const AvailableRidesPage(),
|
||||||
'History of Trip'.tr,
|
transition: Transition.rightToLeftWithFade),
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
Get.to(() => const HistoryCaptain(),
|
|
||||||
transition: Transition.downToUp);
|
|
||||||
// Handle history of trip item tap
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
ListTile(
|
_buildDivider(),
|
||||||
leading: const Icon(Icons.phonelink_ring_rounded),
|
_buildDrawerItem(
|
||||||
title: Text(
|
icon: Icons.notifications,
|
||||||
'Available for rides'.tr,
|
text: 'Notifications'.tr,
|
||||||
style: AppStyle.title,
|
onTap: () => Get.to(() => const NotificationCaptain(),
|
||||||
),
|
transition: Transition.upToDown),
|
||||||
onTap: () {
|
|
||||||
Get.to(() => const AvailableRidesPage(),
|
|
||||||
transition: Transition.rightToLeftWithFade);
|
|
||||||
// Handle history of trip item tap
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
ListTile(
|
_buildDivider(),
|
||||||
leading: const Icon(Icons.notifications),
|
_buildDrawerItem(
|
||||||
title: Text(
|
icon: Icons.help,
|
||||||
'Notifications'.tr,
|
text: 'Helping Center'.tr,
|
||||||
style: AppStyle.title,
|
onTap: () =>
|
||||||
),
|
Get.to(() => HelpCaptain(), transition: Transition.size),
|
||||||
onTap: () {
|
|
||||||
// Handle notifications item tap
|
|
||||||
Get.to(() => const NotificationCaptain(),
|
|
||||||
transition: Transition.upToDown);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
ListTile(
|
_buildDivider(),
|
||||||
leading: const Icon(Icons.help),
|
_buildDrawerItem(
|
||||||
title: Text(
|
icon: Icons.settings,
|
||||||
'Helping Center'.tr,
|
text: 'Settings'.tr,
|
||||||
style: AppStyle.title,
|
onTap: () => Get.to(() => const SettingsCaptain(),
|
||||||
),
|
transition: Transition.cupertino),
|
||||||
onTap: () {
|
|
||||||
// Handle helping center item tap
|
|
||||||
Get.to(() => HelpCaptain(), transition: Transition.size);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
ListTile(
|
_buildDivider(),
|
||||||
leading: const Icon(Icons.settings),
|
_buildDrawerItem(
|
||||||
title: Text(
|
icon: Icons.exit_to_app,
|
||||||
'Settings'.tr,
|
text: 'Sign Out'.tr,
|
||||||
style: AppStyle.title,
|
onTap: () => Get.to(() => const LogoutCaptain(),
|
||||||
),
|
transition: Transition.cupertinoDialog),
|
||||||
onTap: () {
|
|
||||||
// Handle settings item tap
|
|
||||||
Get.to(() => const SettingsCaptain(),
|
|
||||||
transition: Transition.cupertino);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
leading: const Icon(Icons.exit_to_app),
|
|
||||||
title: Text(
|
|
||||||
'Sign Out'.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
// Handle sign out item tap
|
|
||||||
Get.to(() => const LogoutCaptain(),
|
|
||||||
transition: Transition.cupertinoDialog);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
|
_buildDivider(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildDivider() {
|
||||||
|
return const Divider(
|
||||||
|
thickness: 1,
|
||||||
|
height: 1,
|
||||||
|
color: AppColor.accentColor,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildDrawerItem({
|
||||||
|
required IconData icon,
|
||||||
|
required String text,
|
||||||
|
required GestureTapCallback onTap,
|
||||||
|
}) {
|
||||||
|
return ListTile(
|
||||||
|
leading: Icon(icon, color: AppColor.accentColor),
|
||||||
|
title: Text(text, style: AppStyle.title),
|
||||||
|
onTap: onTap,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class UserAccountHeader extends StatelessWidget {
|
||||||
|
const UserAccountHeader({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return UserAccountsDrawerHeader(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: AppColor.gradientStartEnd,
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
currentAccountPictureSize: const Size.square(100),
|
||||||
|
arrowColor: AppColor.deepPurpleAccent,
|
||||||
|
accountName: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
box.read(BoxName.nameDriver).toString(),
|
||||||
|
style: AppStyle.title.copyWith(color: AppColor.backgroundColor),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
Get.find<HomeCaptainController>().rating.toString(),
|
||||||
|
style: AppStyle.number.copyWith(color: Colors.amber),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
child: RatingBar.builder(
|
||||||
|
initialRating: double.parse(
|
||||||
|
Get.find<HomeCaptainController>().rating.toString()),
|
||||||
|
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.copyWith(color: AppColor.backgroundColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
currentAccountPicture:
|
||||||
|
GetBuilder<ImageController>(builder: (imageController) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
imageController.isloading
|
||||||
|
? const CircularProgressIndicator()
|
||||||
|
: CircleAvatar(
|
||||||
|
radius: 45,
|
||||||
|
backgroundImage: NetworkImage(
|
||||||
|
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
right: 0,
|
||||||
|
top: 0,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
imageController.choosImage(AppLink.uploadImage1, 'portrait');
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.edit),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,59 +120,56 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
(mapDriverController.carType == 'Mashwari' ||
|
// (mapDriverController.carType == 'Mashwari' ||
|
||||||
mapDriverController.carType == 'Comfort') &&
|
// mapDriverController.carType == 'Comfort' ||
|
||||||
mapDriverController.remainingTimeTimerRideBegin > 60
|
// mapDriverController.carType == 'lady') &&
|
||||||
? Row(
|
// mapDriverController.remainingTimeTimerRideBegin > 60
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
// ? Row(
|
||||||
children: [
|
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
MyElevatedButton(
|
// children: [
|
||||||
title: 'End Ride'.tr,
|
// MyElevatedButton(
|
||||||
onPressed: () {
|
// title: 'End Ride'.tr,
|
||||||
mapDriverController.finishRideFromDriver();
|
// onPressed: () {
|
||||||
},
|
// mapDriverController.finishRideFromDriver();
|
||||||
kolor: AppColor.redColor,
|
// },
|
||||||
),
|
// kolor: AppColor.redColor,
|
||||||
Container(
|
// ),
|
||||||
decoration: AppStyle.boxDecoration1,
|
// Container(
|
||||||
child: InkWell(
|
// decoration: AppStyle.boxDecoration1,
|
||||||
onTap: () {
|
// child: Text(
|
||||||
print(Get.find<HomeCaptainController>()
|
// mapDriverController.carType,
|
||||||
.comfortPrice);
|
// style: AppStyle.title,
|
||||||
},
|
// ),
|
||||||
child: Text(
|
// )
|
||||||
mapDriverController.carType,
|
// ],
|
||||||
style: AppStyle.title,
|
// )
|
||||||
),
|
// :
|
||||||
),
|
Row(
|
||||||
)
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
],
|
children: [
|
||||||
)
|
// mapDriverController.remainingTimeTimerRideBegin <
|
||||||
: Row(
|
// 60
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
// ?
|
||||||
children: [
|
MyElevatedButton(
|
||||||
mapDriverController.remainingTimeTimerRideBegin <
|
title: 'End Ride'.tr,
|
||||||
60
|
onPressed: () {
|
||||||
? MyElevatedButton(
|
mapDriverController.finishRideFromDriver();
|
||||||
title: 'End Ride'.tr,
|
},
|
||||||
onPressed: () {
|
kolor: AppColor.redColor,
|
||||||
mapDriverController
|
),
|
||||||
.finishRideFromDriver();
|
// : const SizedBox(),
|
||||||
},
|
Container(
|
||||||
kolor: AppColor.redColor,
|
decoration: AppStyle.boxDecoration1,
|
||||||
)
|
child: Text(
|
||||||
: const SizedBox(),
|
mapDriverController.carType,
|
||||||
Container(
|
style: AppStyle.title,
|
||||||
decoration: AppStyle.boxDecoration1,
|
|
||||||
child: Text(
|
|
||||||
mapDriverController.carType,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
mapDriverController.carType != 'Comfort' &&
|
mapDriverController.carType != 'Comfort' &&
|
||||||
mapDriverController.carType != 'Mashwari'
|
mapDriverController.carType != 'Mashwari' &&
|
||||||
|
mapDriverController.carType != 'Lady'
|
||||||
? Stack(
|
? Stack(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
Reference in New Issue
Block a user