11/20/1
This commit is contained in:
@@ -190,7 +190,8 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
.totalPassengerRayehGai
|
||||
.toStringAsFixed(
|
||||
1)
|
||||
: '50',
|
||||
: 'Pre-booking'
|
||||
.tr,
|
||||
style:
|
||||
AppStyle.title.copyWith(fontSize: 20),
|
||||
),
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:SEFER/views/auth/login_page.dart';
|
||||
import 'package:SEFER/views/auth/sms_verfy_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/notification.dart';
|
||||
import '../../../controller/firebase/local_notification.dart';
|
||||
import '../../../controller/functions/crud.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../../controller/home/vip_waitting_page.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
@@ -88,135 +82,23 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () async {
|
||||
// Get.to(SmsSignupEgypt());
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Icons.voice_chat,
|
||||
// size: 29,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () async {
|
||||
// Get.to(SmsSignupEgypt());
|
||||
// List<String> d = [
|
||||
// "30.003028,31.2419628",
|
||||
// "30.0955661,31.2665336",
|
||||
// "160.00",
|
||||
// "25.92",
|
||||
// "1488",
|
||||
// "16.93",
|
||||
// "114243034311436865474",
|
||||
// "113172279072358305645",
|
||||
// "hamza ayed",
|
||||
// "rlMbi4Hc8L1STMPE99iPKqK4Gddwv8r9qZOCadsz9qTEJZ6KLEE9ruTJI6N8dKfK4CXez5pme5WIs14-1QGo29s07fQOniZgIlJV5XFL3yqzPRSUmn3",
|
||||
// "+201023248456",
|
||||
// "1 min",
|
||||
// "1 m",
|
||||
// "false",
|
||||
// "QwUMoyUtZ0J3oR6yXKUavrB_gBl9npUZe-qZtax-Raq4QBbdKv0AmtLKm0BfBd6N_592HBv4CVa41ii4122W3hr-BCUKKzJhzZcK8m0YjbWbtpvgJRD8uD_nuMk9",
|
||||
// "0",
|
||||
// "238",
|
||||
// "false",
|
||||
// "114243034311436865474",
|
||||
// "1488",
|
||||
// "startEnd",
|
||||
// "30.049307749732176,31.274291574954987",
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "17.73",
|
||||
// "0",
|
||||
// "hamzaayedflutter@gmail.com",
|
||||
// "الفسطاط، حي مصر القديمة، مصر",
|
||||
// " الزاوية الحمراء، محافظة القاهرة، مصر",
|
||||
// "Speed",
|
||||
// "8",
|
||||
// "5.00"
|
||||
// ];
|
||||
|
||||
// FirebaseMessagesController()
|
||||
// .sendNotificationToAnyWithoutData(
|
||||
// 'Cancel'.tr,
|
||||
// "How much longer will you be?".tr,
|
||||
// 'fKBBB4_1R0q18-byySHUeG:APA91bHk2RmjjMt6eKr7KQnqh4CK02yW3H5E8g_beVcQFgiCG50j9KCtSU1O8PtvS_gA5xuJLhaorDV9AeslcyLFJFf302tICKMiKgsDP5pWkF5WXNw0-4NsoD-BnJxf0-Do9Vs1Zbpq',
|
||||
// // d,
|
||||
// 'ding.wav',
|
||||
// );
|
||||
|
||||
// Get.to(SmsSignupEgypt());
|
||||
// Log.print(
|
||||
// 'getUpdatedRideForDriverApply: ${Get.find<MapPassengerController>().driverToken}');
|
||||
// Get.find<MapPassengerController>()
|
||||
// .firstTimeRunToGetCoupon('SEFER25', '1 WEEEK', '25%');
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Icons.chat,
|
||||
// size: 29,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// // AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () async {
|
||||
// await CRUD().allMethodForAI(
|
||||
// 'name,fullName,address,idNumber,cardId,dob',
|
||||
// AppLink.uploadEgypt,
|
||||
// 'idFront');
|
||||
//
|
||||
// // await ImageController().choosImage(
|
||||
// // 'https://api.sefer.live/sefer/uploadEgypt.php',
|
||||
// // 'FrontId');
|
||||
// AC credentials = AC();
|
||||
// String apiKey = 'zjujl_qvo_fwjfgjlXrXlBl';
|
||||
// String convertedStringN = credentials.c(
|
||||
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||
|
||||
// String retrievedStringS = credentials.r(
|
||||
// credentials.r(credentials.r(convertedStringN, cn), cC),
|
||||
// cs);
|
||||
// //
|
||||
// if (retrievedStringS == apiKey) {
|
||||
// print('convertedStringN --- $convertedStringN');
|
||||
// print('retrievedStringS ---$retrievedStringS');
|
||||
// print('same');
|
||||
// }
|
||||
//
|
||||
// // await Get.find<PaymentController>()
|
||||
// // .payWithPayMob(context, '1100', 'EGP');
|
||||
// // Initiates a payment with a card using the FlutterPaymob instance
|
||||
//
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// // Get.put(AudioRecorderController()).isRecording
|
||||
// Icons.start,
|
||||
// size: 29,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () async {
|
||||
Get.to(() => const VipWaittingPage());
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.voice_chat,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
})),
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/api_key.dart';
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../print.dart';
|
||||
|
||||
class CupertinoDriverListWidget extends StatelessWidget {
|
||||
MapPassengerController mapPassengerController =
|
||||
@@ -16,170 +17,207 @@ class CupertinoDriverListWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text('Driver List'.tr),
|
||||
middle: Text('Driver List'.tr), // Ensure text is properly localized
|
||||
),
|
||||
child: SafeArea(
|
||||
child: ListView.separated(
|
||||
itemCount: mapPassengerController.driversForMishwari.length,
|
||||
separatorBuilder: (context, index) => const Divider(height: 1),
|
||||
itemBuilder: (context, index) {
|
||||
var driver = mapPassengerController.driversForMishwari[index];
|
||||
return Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: CupertinoListTile(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||
leading: CircleAvatar(
|
||||
radius: 25,
|
||||
backgroundImage: NetworkImage(
|
||||
'${AppLink.seferCairoServer}/portrate_captain_image/${driver['id']}.jpg',
|
||||
),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
return Image.network(
|
||||
'${AppLink.seferCairoServer}/portrate_captain_image/${driver['id']}.jpg',
|
||||
fit: BoxFit.cover,
|
||||
loadingBuilder: (BuildContext context, Widget child,
|
||||
ImageChunkEvent? loadingProgress) {
|
||||
if (loadingProgress == null) {
|
||||
return child; // Image is loaded
|
||||
} else {
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: loadingProgress.expectedTotalBytes != null
|
||||
? loadingProgress.cumulativeBytesLoaded /
|
||||
(loadingProgress.expectedTotalBytes ?? 1)
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
errorBuilder: (BuildContext context, Object error,
|
||||
StackTrace? stackTrace) {
|
||||
return const Icon(
|
||||
Icons.person, // Icon to show when image fails to load
|
||||
size: 25, // Adjust the size as needed
|
||||
color: AppColor.blueColor, // Color for the error icon
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${driver['NAME'].toString().split(' ')[0]} ${driver['NAME'].toString().split(' ')[1]}',
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
child: mapPassengerController.driversForMishwari.isEmpty
|
||||
? Center(
|
||||
child: Text(
|
||||
'No drivers available at the moment. Please try again later.'
|
||||
.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 18, // Adjust the size as needed
|
||||
fontWeight: FontWeight.w600,
|
||||
color: CupertinoColors.inactiveGray, // Customize color
|
||||
),
|
||||
textAlign: TextAlign.center, // Center-align the text
|
||||
),
|
||||
Text('${'Age'.tr}: ${driver['age'].toString()}'),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(CupertinoIcons.star_fill,
|
||||
size: 16, color: CupertinoColors.systemYellow),
|
||||
const SizedBox(width: 4),
|
||||
Text(driver['rating']?.toStringAsFixed(1) ?? 'N/A'.tr),
|
||||
const SizedBox(width: 8),
|
||||
Text('${'Rides'.tr}: ${driver['countRide']}'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Car'.tr}: ${driver['make']} ${driver['model']} (${driver['year']})'),
|
||||
Text('${'Plate'.tr}: ${driver['car_plate']}'),
|
||||
],
|
||||
),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text('${'Education'.tr}: ${driver['education']}'),
|
||||
// ],
|
||||
// ),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
// width: Get.width * .3,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('${'Color'.tr}: ${driver['color']}'),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
color: driver['color_hex'].toString() == 'null'
|
||||
? Colors.amber
|
||||
: hexToColor(
|
||||
driver['color_hex'].toString()),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: ListView.separated(
|
||||
itemCount: mapPassengerController.driversForMishwari.length,
|
||||
separatorBuilder: (context, index) =>
|
||||
const Divider(height: 1),
|
||||
itemBuilder: (context, index) {
|
||||
var driver =
|
||||
mapPassengerController.driversForMishwari[index];
|
||||
return Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: CupertinoListTile(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 4, horizontal: 8),
|
||||
leading: CircleAvatar(
|
||||
radius: 25,
|
||||
backgroundImage: NetworkImage(
|
||||
'${AppLink.seferCairoServer}/portrate_captain_image/${driver['id']}.jpg',
|
||||
),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
return Image.network(
|
||||
'${AppLink.seferCairoServer}/portrate_captain_image/${driver['id']}.jpg',
|
||||
fit: BoxFit.cover,
|
||||
loadingBuilder: (BuildContext context,
|
||||
Widget child,
|
||||
ImageChunkEvent? loadingProgress) {
|
||||
if (loadingProgress == null) {
|
||||
return child; // Image is loaded
|
||||
} else {
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: loadingProgress
|
||||
.expectedTotalBytes !=
|
||||
null
|
||||
? loadingProgress
|
||||
.cumulativeBytesLoaded /
|
||||
(loadingProgress
|
||||
.expectedTotalBytes ??
|
||||
1)
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
errorBuilder: (BuildContext context,
|
||||
Object error, StackTrace? stackTrace) {
|
||||
return const Icon(
|
||||
Icons
|
||||
.person, // Icon to show when image fails to load
|
||||
size: 25, // Adjust the size as needed
|
||||
color: AppColor
|
||||
.blueColor, // Color for the error icon
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
// Handle driver selection
|
||||
Get.defaultDialog(
|
||||
title: '${'Selected driver'.tr}: ${driver['NAME']}',
|
||||
content: Column(
|
||||
children: [
|
||||
Column(
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Car'.tr}: ${driver['make']} ${driver['model']} (${driver['year']})'),
|
||||
Text('${'Plate'.tr}: ${driver['car_plate']}'),
|
||||
'${driver['NAME'].toString().split(' ')[0]} ${driver['NAME'].toString().split(' ')[1]}',
|
||||
style:
|
||||
const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text('${'Age'.tr}: ${driver['age'].toString()}'),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('${'Color'.tr}: ${driver['color']}'),
|
||||
const Icon(CupertinoIcons.star_fill,
|
||||
size: 16,
|
||||
color: CupertinoColors.systemYellow),
|
||||
const SizedBox(width: 4),
|
||||
Text(driver['rating']?.toStringAsFixed(1) ??
|
||||
'N/A'.tr),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
driver['color_hex'].toString() == 'null'
|
||||
? Colors.amber
|
||||
: hexToColor(
|
||||
driver['color_hex'].toString()),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(),
|
||||
Text('${'Rides'.tr}: ${driver['ride_count']}'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Car'.tr}: ${driver['make']} ${driver['model']} (${driver['year']})'),
|
||||
Text('${'Plate'.tr}: ${driver['car_plate']}'),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
// width: Get.width * .3,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('${'Color'.tr}: ${driver['color']}'),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
color: driver['color_hex']
|
||||
.toString() ==
|
||||
'null'
|
||||
? Colors.amber
|
||||
: hexToColor(driver['color_hex']
|
||||
.toString()),
|
||||
borderRadius:
|
||||
BorderRadius.circular(4),
|
||||
border: Border.all(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
showDateTimePickerDialog(driver);
|
||||
}));
|
||||
print('${'Selected driver'.tr}: ${driver['NAME']}');
|
||||
// Get.back(); // Close the dialog
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
)),
|
||||
onTap: () {
|
||||
Log.print(' driver["id"]: ${driver['driver_id']}');
|
||||
Get.find<MapPassengerController>().driverIdVip =
|
||||
driver['driver_id'];
|
||||
|
||||
// Handle driver selection
|
||||
Get.defaultDialog(
|
||||
title:
|
||||
'${'Selected driver'.tr}: ${driver['NAME']}',
|
||||
content: Column(
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Car'.tr}: ${driver['make']} ${driver['model']} (${driver['year']})'),
|
||||
Text(
|
||||
'${'Plate'.tr}: ${driver['car_plate']}'),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'${'Color'.tr}: ${driver['color']}'),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
color: driver['color_hex']
|
||||
.toString() ==
|
||||
'null'
|
||||
? Colors.amber
|
||||
: hexToColor(
|
||||
driver['color_hex']
|
||||
.toString()),
|
||||
borderRadius:
|
||||
BorderRadius.circular(4),
|
||||
border: Border.all(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
showDateTimePickerDialog(driver);
|
||||
}));
|
||||
print('${'Selected driver'.tr}: ${driver['NAME']}');
|
||||
// Get.back(); // Close the dialog
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -233,7 +271,7 @@ class CupertinoDriverListWidget extends StatelessWidget {
|
||||
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'select date and time of trip'.tr,
|
||||
title: "Select date and time of trip".tr,
|
||||
content: SizedBox(
|
||||
// height: 400, // Adjust height as needed
|
||||
width: double.maxFinite,
|
||||
@@ -253,6 +291,13 @@ class CupertinoDriverListWidget extends StatelessWidget {
|
||||
await mapPassengerController.saveTripData(driver, selectedDateTime);
|
||||
},
|
||||
),
|
||||
cancel: MyElevatedButton(
|
||||
kolor: AppColor.redColor,
|
||||
title: 'Cancel'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -263,10 +308,10 @@ class DateTimePickerWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
transitionBetweenRoutes: false,
|
||||
automaticallyImplyLeading: false,
|
||||
middle: Text('Date and Time Picker'),
|
||||
middle: Text('Date and Time Picker'.tr),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user