This commit is contained in:
Hamza-Ayed
2024-07-21 09:48:56 +03:00
parent 6889985afc
commit 485928d8c1
16 changed files with 860 additions and 385 deletions

View File

@@ -29,7 +29,7 @@ class CRUD {
);
print(response.request);
print(response.body);
print(payload);
// print(payload);
// if (response.statusCode == 200) {
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {

View File

@@ -23,13 +23,6 @@ class ImageController extends GetxController {
image = File(pickedImage!.path);
croppedFile = await ImageCropper().cropImage(
sourcePath: image!.path,
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.ratio3x2,
CropAspectRatioPreset.original,
CropAspectRatioPreset.ratio4x3,
CropAspectRatioPreset.ratio16x9
],
uiSettings: [
AndroidUiSettings(
toolbarTitle: 'Cropper'.tr,

View File

@@ -24,7 +24,9 @@ import '../../constant/links.dart';
import '../../constant/table_names.dart';
import '../../main.dart';
import '../../models/model/locations.dart';
import '../../print.dart';
import '../../views/home/map_widget.dart/car_details_widget_to_go.dart';
import '../../views/home/map_widget.dart/select_driver_mishwari.dart';
import '../../views/widgets/elevated_btn.dart';
import '../firebase/firbase_messge.dart';
import '../functions/audio_record1.dart';
@@ -2815,6 +2817,72 @@ class MapPassengerController extends GetxController {
update();
}
Future selectDriverAndCarForMishwariTrip() async {
var res = await CRUD()
.get(link: AppLink.selectDriverAndCarForMishwariTrip, payload: {});
if (res != 'failure') {
var d = jsonDecode(res);
return d['message'];
} else {
return 'No driver available now try later time\nthanks for using our app'
.tr;
}
}
final Rx<DateTime> selectedDateTime = DateTime.now().obs;
void updateDateTime(DateTime newDateTime) {
selectedDateTime.value = newDateTime;
}
Future mishwariOption() async {
// isBottomSheetShown = false;
update();
// add dialoug for select driver and car
List driversForMishwari = await selectDriverAndCarForMishwariTrip();
Future.delayed(Duration.zero);
Log.print('driversForMishwari: ${driversForMishwari}');
Get.to(() => CupertinoDriverListWidget(
drivers: driversForMishwari,
));
// add dialoug to select date and time
// changeCashConfirmPageShown();
}
Future<void> saveTripData(
Map<String, dynamic> driver, DateTime tripDateTime) async {
try {
// Prepare trip data
Map<String, dynamic> tripData = {
'driver_id': driver['id'],
'passenger_id': box.read(BoxName.passengerID),
'trip_datetime': tripDateTime.toIso8601String(),
// Add other necessary trip details
};
// Send data to server
var response =
await CRUD().post(link: AppLink.addAdminUser, payload: tripData);
if (response != 'failure') {
// Trip saved successfully
Get.snackbar('Success'.tr, 'Trip booked successfully'.tr);
// Set up local notification
// await setLocalNotification(tripDateTime);
// Send notification to driver
// await FirebaseMessagesController().sendNotificationToDriverMAP();
} else {
throw Exception('Failed to save trip');
}
} catch (e) {
Get.snackbar('Error'.tr, 'Failed to book trip: $e'.tr);
}
}
initilizeGetStorage() async {
if (box.read(BoxName.addWork) == null) {
box.write(BoxName.addWork, 'addWork');

View File

@@ -606,17 +606,28 @@ iOS [https://getapp.cc/app/6458734951]
"اِذْهَب إِلَى الْخُطْوَة الْتَّالِيَة\naاسْتِخْرَاج رُخْصَة السَّيَّارَة.",
"Name in arabic": "الاِسْم بِاللُّغَة الْعَرَبِيَّة",
"Drivers License Class": "فَئَة رُخْصَة الْقِيَادَة",
"National Number": "الرَّقْم الْقَوْمِي",
"Address": "الْعُنْوَان",
"Date of Birth": "تَارِيخ الْمِيلَاد",
"Age": "الْعُمْر",
"Expiry Date": "تَارِيخ الإِنْتِهَاء",
'Select date and time of trip': 'اختر تاريخ ووقت الرحلة',
'Selected Date': 'التاريخ المحدد',
'Select Time': 'اختر الوقت',
'Selected Time': 'الوقت المحدد',
'OK': 'موافق',
'Cancel': 'إلغاء',
'Selected Date and Time': "التاريخ والوقت المحددان",
"Lets check Car license ":
"دَعْنَا نَتَحَقَّق مِن رُخْصَة السَّيَّارَة ",
"Color": "اللَّوْن",
"Car Kind": "نَوْع السَّيَّارَة",
"Year": "السَّنَة",
"Car Plate": "لَوْحَة السَّيَّارَة",
'Driver List': 'قائمة السائقين',
'Car': 'السيارة',
'Plate': 'لوحة السيارة',
'N/A': 'غير متوفر',
'Rides': 'الرحلات',
'Age': 'العمر',
'Education': 'التعليم',
'Color': 'اللون',
'Displacement': 'السعة',
'Fuel': 'الوقود',
'Selected driver': 'السائق المختار',
"Lets check License Back Face":
"دَعْنَا نَتَحَقَّق مِن الْوَجْه الْخَلْفِي لِلرُّخْصَة",
"Car License Card": "بَطَاقَة رُخْصَة السَّيَّارَة",