7/21/2
This commit is contained in:
@@ -55,8 +55,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 34
|
||||
versionCode 50
|
||||
versionName '1.5.50'
|
||||
versionCode 51
|
||||
versionName '1.5.51'
|
||||
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||
}
|
||||
|
||||
|
||||
@@ -1,74 +1,73 @@
|
||||
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||
|
||||
import '../env/env.dart';
|
||||
import 'char_map.dart';
|
||||
import 'credential.dart';
|
||||
|
||||
class AK {
|
||||
static final AC a = AC();
|
||||
|
||||
static final String publishableKey =
|
||||
AC().r(AC().r(AC().r(Env.stripePublishableKe, cn), cC), cs);
|
||||
static final String secretKey = a.r(a.r(a.r(Env.secretKey, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.stripePublishableKe, cn), cC), cs);
|
||||
static final String secretKey = X.r(X.r(X.r(Env.secretKey, cn), cC), cs);
|
||||
static final String basicAuthCredentials =
|
||||
a.r(a.r(a.r(Env.basicAuthCredentials, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.basicAuthCredentials, cn), cC), cs);
|
||||
static final String accountSIDTwillo =
|
||||
a.r(a.r(a.r(Env.accountSIDTwillo, cn), cC), cs);
|
||||
static final String serverAPI = a.r(a.r(a.r(Env.serverAPI, cn), cC), cs);
|
||||
static final String mapAPIKEY = a.r(a.r(a.r(Env.mapAPIKEY, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.accountSIDTwillo, cn), cC), cs);
|
||||
static final String serverAPI = X.r(X.r(X.r(Env.serverAPI, cn), cC), cs);
|
||||
static final String mapAPIKEY = X.r(X.r(X.r(Env.mapAPIKEY, cn), cC), cs);
|
||||
static final String twilloRecoveryCode =
|
||||
a.r(a.r(a.r(Env.twilloRecoveryCode, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.twilloRecoveryCode, cn), cC), cs);
|
||||
static final String authTokenTwillo =
|
||||
a.r(a.r(a.r(Env.authTokenTwillo, cn), cC), cs);
|
||||
static final String chatGPTkey = a.r(a.r(a.r(Env.chatGPTkey, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.authTokenTwillo, cn), cC), cs);
|
||||
static final String chatGPTkey = X.r(X.r(X.r(Env.chatGPTkey, cn), cC), cs);
|
||||
static final String transactionCloude =
|
||||
a.r(a.r(a.r(Env.transactionCloude, cn), cC), cs);
|
||||
static final String visionApi = a.r(a.r(a.r(Env.visionApi, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.transactionCloude, cn), cC), cs);
|
||||
static final String visionApi = X.r(X.r(X.r(Env.visionApi, cn), cC), cs);
|
||||
static final String chatGPTkeySefer =
|
||||
a.r(a.r(a.r(Env.chatGPTkeySefer, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.chatGPTkeySefer, cn), cC), cs);
|
||||
static final String chatGPTkeySeferNew =
|
||||
a.r(a.r(a.r(Env.chatGPTkeySeferNew, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.chatGPTkeySeferNew, cn), cC), cs);
|
||||
static final String serverPHP = Env.serverPHP;
|
||||
static final String llamaKey = a.r(a.r(a.r(Env.llamaKey, cn), cC), cs);
|
||||
static final String cohere = a.r(a.r(a.r(Env.cohere, cn), cC), cs);
|
||||
static final String claudeAiAPI = a.r(a.r(a.r(Env.claudeAiAPI, cn), cC), cs);
|
||||
static final String llamaKey = X.r(X.r(X.r(Env.llamaKey, cn), cC), cs);
|
||||
static final String cohere = X.r(X.r(X.r(Env.cohere, cn), cC), cs);
|
||||
static final String claudeAiAPI = X.r(X.r(X.r(Env.claudeAiAPI, cn), cC), cs);
|
||||
static final String payPalClientId =
|
||||
a.r(a.r(a.r(Env.payPalClientId, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payPalClientId, cn), cC), cs);
|
||||
static final String payPalSecret =
|
||||
a.r(a.r(a.r(Env.payPalSecret, cn), cC), cs);
|
||||
static final String geminiApi = a.r(a.r(a.r(Env.geminiApi, cn), cC), cs);
|
||||
static final String agoraAppId = a.r(a.r(a.r(Env.agoraAppId, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payPalSecret, cn), cC), cs);
|
||||
static final String geminiApi = X.r(X.r(X.r(Env.geminiApi, cn), cC), cs);
|
||||
static final String agoraAppId = X.r(X.r(X.r(Env.agoraAppId, cn), cC), cs);
|
||||
static final String agoraAppCertificate =
|
||||
a.r(a.r(a.r(Env.agoraAppCertificate, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.agoraAppCertificate, cn), cC), cs);
|
||||
static final String payPalClientIdLive =
|
||||
a.r(a.r(a.r(Env.payPalClientIdLive, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payPalClientIdLive, cn), cC), cs);
|
||||
static final String payPalSecretLive =
|
||||
a.r(a.r(a.r(Env.payPalSecretLive, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payPalSecretLive, cn), cC), cs);
|
||||
static final String integrationIdPayMob =
|
||||
a.r(a.r(a.r(Env.integrationIdPayMob, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.integrationIdPayMob, cn), cC), cs);
|
||||
static final String passwordPayMob =
|
||||
a.r(a.r(a.r(Env.passwordPayMob, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.passwordPayMob, cn), cC), cs);
|
||||
static final String usernamePayMob =
|
||||
a.r(a.r(a.r(Env.usernamePayMob, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.usernamePayMob, cn), cC), cs);
|
||||
static final String payMobApikey =
|
||||
a.r(a.r(a.r(Env.payMobApikey, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobApikey, cn), cC), cs);
|
||||
static final String integrationIdPayMobWallet =
|
||||
a.r(a.r(a.r(Env.integrationIdPayMobWallet, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.integrationIdPayMobWallet, cn), cC), cs);
|
||||
static final String smsPasswordEgypt =
|
||||
a.r(a.r(a.r(Env.smsPasswordEgypt, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.smsPasswordEgypt, cn), cC), cs);
|
||||
static final String ocpApimSubscriptionKey = Env.ocpApimSubscriptionKey;
|
||||
static final String chatGPTkeySeferNew4 =
|
||||
a.r(a.r(a.r(Env.chatGPTkeySeferNew4, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.chatGPTkeySeferNew4, cn), cC), cs);
|
||||
static final String anthropicAIkeySeferNew =
|
||||
a.r(a.r(a.r(Env.anthropicAIkeySeferNew, cn), cC), cs);
|
||||
static final String llama3Key = a.r(a.r(a.r(Env.llama3Key, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.anthropicAIkeySeferNew, cn), cC), cs);
|
||||
static final String llama3Key = X.r(X.r(X.r(Env.llama3Key, cn), cC), cs);
|
||||
static final String payMobOutClientSecrret =
|
||||
a.r(a.r(a.r(Env.payMobOutClientSecrret, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobOutClientSecrret, cn), cC), cs);
|
||||
static final String payMobOutClient_id =
|
||||
a.r(a.r(a.r(Env.payMobOutClient_id, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobOutClient_id, cn), cC), cs);
|
||||
static final String payMobOutPassword =
|
||||
a.r(a.r(a.r(Env.payMobOutPassword, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobOutPassword, cn), cC), cs);
|
||||
static final String payMobOutUserName =
|
||||
a.r(a.r(a.r(Env.payMobOutUserName, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobOutUserName, cn), cC), cs);
|
||||
|
||||
///////////
|
||||
static final String keyOfApp = a.r(a.r(a.r(Env.keyOfApp, cn), cC), cs);
|
||||
static final String keyOfApp = X.r(X.r(X.r(Env.keyOfApp, cn), cC), cs);
|
||||
}
|
||||
|
||||
@@ -129,6 +129,8 @@ class AppLink {
|
||||
//-----------------RegisrationCar------------------
|
||||
static String addRegisrationCar = "$ride/RegisrationCar/add.php";
|
||||
static String getRegisrationCar = "$ride/RegisrationCar/get.php";
|
||||
static String selectDriverAndCarForMishwariTrip =
|
||||
"$ride/RegisrationCar/selectDriverAndCarForMishwariTrip.php";
|
||||
static String updateRegisrationCar = "$ride/RegisrationCar/update.php";
|
||||
|
||||
//-----------------DriverOrder------------------
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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": "بَطَاقَة رُخْصَة السَّيَّارَة",
|
||||
|
||||
@@ -47,7 +47,7 @@ void main() async {
|
||||
|
||||
await GetStorage.init();
|
||||
// Get.put(DriverCallController());
|
||||
await AC().gAK();
|
||||
// await AC().gAK();
|
||||
'local is ${WidgetsBinding.instance.platformDispatcher.locale.countryCode}';
|
||||
|
||||
Stripe.publishableKey = AK.publishableKey;
|
||||
|
||||
13
lib/print.dart
Normal file
13
lib/print.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'dart:developer' as developer;
|
||||
|
||||
class Log {
|
||||
Log._();
|
||||
|
||||
static void print(String value, {StackTrace? stackTrace}) {
|
||||
developer.log(value, name: 'LOG', stackTrace: stackTrace);
|
||||
}
|
||||
|
||||
static Object? inspect(Object? object) {
|
||||
return developer.inspect(object);
|
||||
}
|
||||
}
|
||||
@@ -296,7 +296,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
mapPassengerController
|
||||
.totalPassengerComfort;
|
||||
Get.defaultDialog(
|
||||
title: 'Comfort',
|
||||
title: 'Comfort'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
@@ -330,7 +330,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
mapPassengerController
|
||||
.totalPassengerSpeed;
|
||||
Get.defaultDialog(
|
||||
title: 'Speed',
|
||||
title: 'Speed'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
@@ -364,7 +364,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
mapPassengerController
|
||||
.totalPassengerMotoDelivery;
|
||||
Get.defaultDialog(
|
||||
title: 'Delivery',
|
||||
title: 'Delivery'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
@@ -396,7 +396,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
box.write(BoxName.carType, 'Mashwari');
|
||||
mapPassengerController.totalPassenger = 50;
|
||||
Get.defaultDialog(
|
||||
title: 'Mashwari',
|
||||
title: 'Mashwari'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
@@ -411,10 +411,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
mapPassengerController
|
||||
.isBottomSheetShown = false;
|
||||
mapPassengerController.update();
|
||||
mapPassengerController
|
||||
.changeCashConfirmPageShown();
|
||||
.mishwariOption();
|
||||
}),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
@@ -429,7 +426,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
mapPassengerController.totalPassenger =
|
||||
mapPassengerController.totalPassengerLady;
|
||||
Get.defaultDialog(
|
||||
title: 'Lady',
|
||||
title: 'Lady'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
|
||||
285
lib/views/home/map_widget.dart/select_driver_mishwari.dart
Normal file
285
lib/views/home/map_widget.dart/select_driver_mishwari.dart
Normal file
@@ -0,0 +1,285 @@
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/api_key.dart';
|
||||
|
||||
class CupertinoDriverListWidget extends StatelessWidget {
|
||||
final List drivers;
|
||||
|
||||
const CupertinoDriverListWidget({super.key, required this.drivers});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text('Driver List'.tr),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: ListView.separated(
|
||||
itemCount: drivers.length,
|
||||
separatorBuilder: (context, index) => const Divider(height: 1),
|
||||
itemBuilder: (context, index) {
|
||||
var driver = drivers[index];
|
||||
return Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: CupertinoListTile(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||
leading: CircleAvatar(
|
||||
radius: 25,
|
||||
backgroundImage: NetworkImage(
|
||||
'${AK.serverPHP}/portrate_captain_image/${driver['id']}.jpg',
|
||||
),
|
||||
backgroundColor: CupertinoColors.systemGrey5,
|
||||
),
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${driver['NAME'].toString().split(' ')[0]} ${driver['NAME'].toString().split(' ')[1]}',
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
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:
|
||||
hexToColor(driver['color_hex'].toString()),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
// 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: hexToColor(
|
||||
driver['color_hex'].toString()),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
showDateTimePickerDialog();
|
||||
}));
|
||||
print('${'Selected driver'.tr}: ${driver['NAME']}');
|
||||
// Get.back(); // Close the dialog
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
Color hexToColor(String hexColor) {
|
||||
hexColor = hexColor.replaceAll("#", "");
|
||||
String colorString = "ff$hexColor";
|
||||
return Color(int.parse(colorString, radix: 16));
|
||||
}
|
||||
|
||||
void showDriverSelectionDialog(Map<String, dynamic> driver) {
|
||||
Get.defaultDialog(
|
||||
title: '${'Selected driver'.tr}: ${driver['name']}',
|
||||
content: 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: hexToColor(driver['color_hex'].toString()),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
showDateTimePickerDialog();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void showDateTimePickerDialog() {
|
||||
DateTime selectedDateTime = DateTime.now();
|
||||
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'select date and time of trip'.tr,
|
||||
content: SizedBox(
|
||||
// height: 400, // Adjust height as needed
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
children: [
|
||||
DateTimePickerWidget(),
|
||||
],
|
||||
),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Confirm Trip'.tr,
|
||||
onPressed: () async {
|
||||
DateTime selectedDateTime =
|
||||
Get.find<MapPassengerController>().selectedDateTime.value;
|
||||
// Save trip data and set up notifications
|
||||
// await Get.find<MapPassengerController>().saveTripData(driver, selectedDateTime);
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DateTimePickerWidget extends StatelessWidget {
|
||||
final MapPassengerController controller = Get.put(MapPassengerController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
transitionBetweenRoutes: false,
|
||||
automaticallyImplyLeading: false,
|
||||
middle: Text('Date and Time Picker'),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Obx(() => Text(
|
||||
'${'Selected Date and Time'.tr}: ${controller.selectedDateTime.value}',
|
||||
style: const TextStyle(fontSize: 18),
|
||||
textAlign: TextAlign.center,
|
||||
)),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: CupertinoDatePicker(
|
||||
mode: CupertinoDatePickerMode.dateAndTime,
|
||||
initialDateTime: controller.selectedDateTime.value,
|
||||
onDateTimeChanged: (newDateTime) {
|
||||
controller.updateDateTime(newDateTime);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Future<void> setLocalNotification(DateTime tripDateTime) async {
|
||||
// FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||
// FlutterLocalNotificationsPlugin();
|
||||
|
||||
// var androidPlatformChannelSpecifics = const AndroidNotificationDetails(
|
||||
// 'trip_reminder_channel',
|
||||
// 'Trip Reminders',
|
||||
// importance: Importance.max,
|
||||
// priority: Priority.high,
|
||||
// );
|
||||
// var iOSPlatformChannelSpecifics = IOSNotificationDetails();
|
||||
// var platformChannelSpecifics = NotificationDetails(
|
||||
// android: androidPlatformChannelSpecifics,
|
||||
// iOS: iOSPlatformChannelSpecifics,
|
||||
// );
|
||||
|
||||
// await flutterLocalNotificationsPlugin.schedule(
|
||||
// 0,
|
||||
// 'Trip Reminder'.tr,
|
||||
// 'Your trip is scheduled in 30 minutes'.tr,
|
||||
// tripDateTime.subtract(const Duration(minutes: 30)),
|
||||
// platformChannelSpecifics,
|
||||
// );
|
||||
// }
|
||||
653
pubspec.lock
653
pubspec.lock
File diff suppressed because it is too large
Load Diff
30
pubspec.yaml
30
pubspec.yaml
@@ -11,39 +11,41 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
cupertino_icons: ^1.0.2
|
||||
firebase_messaging: ^14.6.7
|
||||
firebase_core: ^2.15.0
|
||||
flutter_local_notifications: ^16.2.0
|
||||
secure_string_operations:
|
||||
path: ./secure_string_operations
|
||||
firebase_messaging: ^15.0.3
|
||||
firebase_core: ^3.2.0
|
||||
flutter_local_notifications: ^17.2.1+2
|
||||
google_maps_flutter: ^2.5.0
|
||||
sqflite: ^2.3.0
|
||||
path: ^1.8.3
|
||||
intl: ^0.18.1
|
||||
http: ^0.13.6
|
||||
intl: ^0.19.0
|
||||
http: ^1.2.2
|
||||
get: ^4.6.5
|
||||
get_storage: ^2.1.1
|
||||
url_launcher: ^6.1.20
|
||||
location: ^5.0.2+1
|
||||
location: ^7.0.0
|
||||
google_polyline_algorithm: ^3.1.0
|
||||
animated_text_kit: ^4.2.2
|
||||
flutter_secure_storage: ^9.0.0
|
||||
geolocator: ^10.0.0
|
||||
geolocator: ^12.0.0
|
||||
flutter_paypal: ^0.2.0
|
||||
google_fonts: ^4.0.4
|
||||
google_fonts: ^6.2.1
|
||||
flutter_launcher_icons: ^0.13.1
|
||||
flutter_rating_bar: ^4.0.1
|
||||
flutter_font_icons: ^2.2.5
|
||||
image_picker: ^1.0.4
|
||||
flutter_stripe: ^9.5.0+1
|
||||
flutter_stripe: ^10.2.0
|
||||
# camera: ^0.10.5+5 #to be remove
|
||||
flutter_widget_from_html: ^0.14.6
|
||||
flutter_widget_from_html: ^0.15.1
|
||||
local_auth: ^2.1.7
|
||||
# image: ^4.1.3 #to be remove
|
||||
image_cropper: ^4.0.1
|
||||
image_cropper: ^7.1.0
|
||||
envied: ^0.5.2
|
||||
# cached_network_image: ^3.3.0
|
||||
calendar_builder: ^0.0.6
|
||||
# agora_rtc_engine: ^6.2.6
|
||||
flutter_tts: ^3.8.5
|
||||
flutter_tts: ^4.0.2
|
||||
permission_handler: ^11.3.0
|
||||
# google_generative_ai: ^0.0.1-dev
|
||||
vibration: ^1.8.4
|
||||
@@ -55,14 +57,14 @@ dependencies:
|
||||
share: ^2.0.4
|
||||
google_sign_in: ^6.2.1
|
||||
sign_in_with_apple: ^6.1.0
|
||||
firebase_auth: ^4.19.6
|
||||
firebase_auth: ^5.1.2
|
||||
package_info_plus: ^8.0.0
|
||||
uni_links: ^0.5.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^ 3.0.1
|
||||
flutter_lints: ^4.0.0
|
||||
envied_generator: ^0.5.2
|
||||
build_runner: ^2.4.6
|
||||
|
||||
|
||||
47
secure_string_operations/lib/secure_string_operations.dart
Normal file
47
secure_string_operations/lib/secure_string_operations.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
// File: lib/secure_string_operations.dart
|
||||
|
||||
library secure_string_operations;
|
||||
|
||||
class X {
|
||||
static String c(String a, Map<String, String> b) {
|
||||
StringBuffer c = StringBuffer();
|
||||
c.write(a);
|
||||
|
||||
String d = "Bl";
|
||||
c.write(b[d] ?? d);
|
||||
|
||||
StringBuffer e = StringBuffer();
|
||||
String f = c.toString();
|
||||
|
||||
for (int g = 0; g < f.length; g++) {
|
||||
String h = f[g];
|
||||
e.write(b[h] ?? h);
|
||||
}
|
||||
|
||||
return e.toString();
|
||||
}
|
||||
|
||||
static String r(String a, Map<String, String> b) {
|
||||
StringBuffer c = StringBuffer();
|
||||
String d = "Bl";
|
||||
int e = d.length;
|
||||
|
||||
for (int f = 0; f < a.length; f++) {
|
||||
String g = a[f];
|
||||
String h = b.keys.firstWhere(
|
||||
(i) => b[i] == g,
|
||||
orElse: () => g,
|
||||
);
|
||||
|
||||
c.write(h);
|
||||
}
|
||||
|
||||
String j = c.toString();
|
||||
|
||||
if (j.endsWith(d)) {
|
||||
j = j.substring(0, j.length - e);
|
||||
}
|
||||
|
||||
return j;
|
||||
}
|
||||
}
|
||||
5
secure_string_operations/pubspec.lock
Normal file
5
secure_string_operations/pubspec.lock
Normal file
@@ -0,0 +1,5 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages: {}
|
||||
sdks:
|
||||
dart: ">=2.12.0 <4.0.0"
|
||||
6
secure_string_operations/pubspec.yaml
Normal file
6
secure_string_operations/pubspec.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
name: secure_string_operations
|
||||
description: A package for secure string operations
|
||||
version: 1.0.0
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
Reference in New Issue
Block a user