25-2/6/1
This commit is contained in:
@@ -61,8 +61,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = flutter.targetSdkVersion
|
targetSdk = flutter.targetSdkVersion
|
||||||
versionCode = 117
|
versionCode = 118
|
||||||
versionName = '2.0.117'
|
versionName = '2.0.118'
|
||||||
multiDexEnabled =true
|
multiDexEnabled =true
|
||||||
|
|
||||||
// manifestPlaceholders can be specified here if needed
|
// manifestPlaceholders can be specified here if needed
|
||||||
|
|||||||
@@ -41,11 +41,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>92</string>
|
<string>93</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>5.0.92</string>
|
<string>5.0.93</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
|
|||||||
@@ -254,8 +254,18 @@ class RegisterController extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// await controller.sendSmsEgypt(phoneNumber, otp.toString());
|
// await controller.sendSmsEgypt(phoneNumber, otp.toString());
|
||||||
} else {
|
} else if (phoneController.text.toString().length >= 10) {
|
||||||
await CRUD().sendWhatsAppAuth(phoneNumber, otp.toString());
|
box.write(BoxName.isVerified, '1');
|
||||||
|
box.write(BoxName.isFirstTime, '0'); //todo check if first or not
|
||||||
|
box.write(
|
||||||
|
BoxName.phone, encryptionHelper.encryptData(phoneController.text));
|
||||||
|
|
||||||
|
Get.put(LoginController()).loginUsingCredentials(
|
||||||
|
box.read(BoxName.passengerID).toString(),
|
||||||
|
box.read(BoxName.email).toString(),
|
||||||
|
);
|
||||||
|
// this for whatsapp messsage
|
||||||
|
// await CRUD().sendWhatsAppAuth(phoneNumber, otp.toString());
|
||||||
}
|
}
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math' show Random, cos, max, min, pi, pow, sin, sqrt;
|
import 'dart:math' show Random, atan2, cos, max, min, pi, pow, sin, sqrt;
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
import 'package:Tripz/constant/univeries_polygon.dart';
|
import 'package:Tripz/constant/univeries_polygon.dart';
|
||||||
@@ -3089,6 +3089,36 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//driver behaviour
|
||||||
|
double calculateBearing(double lat1, double lon1, double lat2, double lon2) {
|
||||||
|
double deltaLon = lon2 - lon1;
|
||||||
|
double y = sin(deltaLon) * cos(lat2);
|
||||||
|
double x = cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(deltaLon);
|
||||||
|
double bearing = atan2(y, x);
|
||||||
|
return (bearing * 180 / pi + 360) % 360; // تحويل إلى درجات
|
||||||
|
}
|
||||||
|
|
||||||
|
void analyzeBehavior(Position currentPosition, List<LatLng> routePoints) {
|
||||||
|
double actualBearing = currentPosition.heading; // الاتجاه الفعلي من GPS
|
||||||
|
double expectedBearing = calculateBearing(
|
||||||
|
routePoints[0].latitude,
|
||||||
|
routePoints[0].longitude,
|
||||||
|
routePoints[1].latitude,
|
||||||
|
routePoints[1].longitude,
|
||||||
|
);
|
||||||
|
|
||||||
|
double bearingDifference = (expectedBearing - actualBearing).abs();
|
||||||
|
if (bearingDifference > 30) {
|
||||||
|
print("⚠️ السائق انحرف عن المسار!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void detectStops(Position currentPosition) {
|
||||||
|
if (currentPosition.speed < 0.5) {
|
||||||
|
print("🚦 السائق توقف في موقع غير متوقع!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> cancelRideAfterRejectFromAll() async {
|
Future<void> cancelRideAfterRejectFromAll() async {
|
||||||
clearPlacesDestination();
|
clearPlacesDestination();
|
||||||
clearPolyline();
|
clearPolyline();
|
||||||
|
|||||||
@@ -74,6 +74,16 @@ class LocaleController extends GetxController {
|
|||||||
appTheme = lightThemeEnglish;
|
appTheme = lightThemeEnglish;
|
||||||
box.write(BoxName.lang, 'hi');
|
box.write(BoxName.lang, 'hi');
|
||||||
break;
|
break;
|
||||||
|
case "ar-ma":
|
||||||
|
locale = const Locale("ar-ma");
|
||||||
|
appTheme = lightThemeArabic;
|
||||||
|
box.write(BoxName.lang, 'ar-ma');
|
||||||
|
break;
|
||||||
|
case "ar-gulf":
|
||||||
|
locale = const Locale("ar-gulf");
|
||||||
|
appTheme = lightThemeArabic;
|
||||||
|
box.write(BoxName.lang, 'ar-gulf');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
locale = Locale(Get.deviceLocale!.languageCode);
|
locale = Locale(Get.deviceLocale!.languageCode);
|
||||||
box.write(BoxName.lang, Get.deviceLocale!.languageCode);
|
box.write(BoxName.lang, Get.deviceLocale!.languageCode);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -145,8 +145,7 @@ class PaymobPaymentWallet {
|
|||||||
}) async {
|
}) async {
|
||||||
final Map<String, dynamic> data = {
|
final Map<String, dynamic> data = {
|
||||||
"source": {
|
"source": {
|
||||||
"identifier": encryptionHelper
|
"identifier": (box.read(BoxName.phoneWallet).toString()),
|
||||||
.decryptData(box.read(BoxName.phoneWallet).toString()),
|
|
||||||
"subtype": "WALLET",
|
"subtype": "WALLET",
|
||||||
},
|
},
|
||||||
"payment_token": paymentToken,
|
"payment_token": paymentToken,
|
||||||
@@ -268,15 +267,15 @@ class PaymobBillingDataWallet {
|
|||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return {
|
return {
|
||||||
"email": box.read(BoxName.email),
|
"email": encryptionHelper.decryptData(box.read(BoxName.email)),
|
||||||
"first_name": encryptionHelper
|
"first_name": encryptionHelper
|
||||||
.decryptData(box.read(BoxName.name).toString().split(' ')[0])
|
.decryptData(box.read(BoxName.name).toString().split(' ')[0])
|
||||||
.toString(),
|
.toString(),
|
||||||
"last_name": encryptionHelper
|
"last_name": encryptionHelper
|
||||||
.decryptData(box.read(BoxName.name).toString().split(' ')[1])
|
.decryptData(box.read(BoxName.name).toString().split(' ')[1])
|
||||||
.toString(),
|
.toString() ??
|
||||||
"phone_number":
|
'tripz',
|
||||||
encryptionHelper.decryptData(box.read(BoxName.phoneWallet)),
|
"phone_number": (box.read(BoxName.phoneWallet)),
|
||||||
"apartment": apartment ?? "NA",
|
"apartment": apartment ?? "NA",
|
||||||
"floor": floor ?? "NA",
|
"floor": floor ?? "NA",
|
||||||
"building": building ?? "NA",
|
"building": building ?? "NA",
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
Get.back(); // Close the dialog
|
Get.back(); // Close the dialog
|
||||||
box.write(
|
box.write(
|
||||||
BoxName.phoneWallet,
|
BoxName.phoneWallet,
|
||||||
controller
|
(controller
|
||||||
.walletphoneController.text);
|
.walletphoneController.text));
|
||||||
Toast.show(
|
Toast.show(
|
||||||
context,
|
context,
|
||||||
'Phone Wallet Saved Successfully'.tr,
|
'Phone Wallet Saved Successfully'.tr,
|
||||||
|
|||||||
@@ -335,10 +335,8 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
|
|||||||
color: CupertinoColors.activeGreen)),
|
color: CupertinoColors.activeGreen)),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
box.write(
|
box.write(BoxName.phoneWallet,
|
||||||
BoxName.phoneWallet,
|
(controller.walletphoneController.text));
|
||||||
encryptionHelper.encryptData(
|
|
||||||
controller.walletphoneController.text));
|
|
||||||
Toast.show(
|
Toast.show(
|
||||||
context,
|
context,
|
||||||
'Phone Wallet Saved Successfully'.tr,
|
'Phone Wallet Saved Successfully'.tr,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:Tripz/views/widgets/elevated_btn.dart';
|
|
||||||
|
|
||||||
import '../../controller/local/local_controller.dart';
|
import '../../controller/local/local_controller.dart';
|
||||||
import '../home/map_page_passenger.dart';
|
import '../home/map_page_passenger.dart';
|
||||||
@@ -16,46 +15,55 @@ class Language extends StatelessWidget {
|
|||||||
middle: Text('Choose Language'.tr),
|
middle: Text('Choose Language'.tr),
|
||||||
border: null,
|
border: null,
|
||||||
),
|
),
|
||||||
child: SafeArea(
|
child: Material(
|
||||||
child: GetBuilder<LocaleController>(
|
// Wrap SafeArea with Material widget
|
||||||
builder: (controller) => Center(
|
child: SafeArea(
|
||||||
child: Padding(
|
child: GetBuilder<LocaleController>(
|
||||||
padding: const EdgeInsets.all(16),
|
builder: (controller) => Center(
|
||||||
child: Column(
|
child: Padding(
|
||||||
children: [
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
_buildHeader(),
|
child: Column(
|
||||||
const SizedBox(height: 20),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Expanded(
|
children: [
|
||||||
child: ListView(
|
_buildHeader(),
|
||||||
physics: const BouncingScrollPhysics(),
|
const SizedBox(height: 20),
|
||||||
children: [
|
Expanded(
|
||||||
_buildLanguageButton(
|
child: ListView(
|
||||||
'العربية', 'ar', controller, context),
|
physics: const BouncingScrollPhysics(),
|
||||||
_buildLanguageButton(
|
children: [
|
||||||
'English', 'en', controller, context),
|
_buildLanguageButton(
|
||||||
_buildLanguageButton(
|
'العربية', 'ar', controller, context, '🇪🇬'),
|
||||||
'Türkçe', 'tr', controller, context),
|
_buildLanguageButton('العربية (الخليج)', 'ar-gulf',
|
||||||
_buildLanguageButton(
|
controller, context, '🇸🇦'),
|
||||||
'Français', 'fr', controller, context),
|
_buildLanguageButton('العربية (المغرب)', 'ar-ma',
|
||||||
_buildLanguageButton(
|
controller, context, '🇲🇦'),
|
||||||
'Italiano', 'it', controller, context),
|
_buildLanguageButton(
|
||||||
_buildLanguageButton(
|
'English', 'en', controller, context, '🇺🇸'),
|
||||||
'Deutsch', 'de', controller, context),
|
_buildLanguageButton(
|
||||||
_buildLanguageButton(
|
'Türkçe', 'tr', controller, context, '🇹🇷'),
|
||||||
'Ελληνικά', 'el', controller, context),
|
_buildLanguageButton(
|
||||||
_buildLanguageButton(
|
'Français', 'fr', controller, context, '🇫🇷'),
|
||||||
'Español', 'es', controller, context),
|
_buildLanguageButton(
|
||||||
_buildLanguageButton(
|
'Italiano', 'it', controller, context, '🇮🇹'),
|
||||||
'فارسی', 'fa', controller, context),
|
_buildLanguageButton(
|
||||||
_buildLanguageButton('中文', 'zh', controller, context),
|
'Deutsch', 'de', controller, context, '🇩🇪'),
|
||||||
_buildLanguageButton(
|
_buildLanguageButton(
|
||||||
'Русский', 'ru', controller, context),
|
'Ελληνικά', 'el', controller, context, '🇬🇷'),
|
||||||
_buildLanguageButton(
|
_buildLanguageButton(
|
||||||
'हिन्दी', 'hi', controller, context),
|
'Español', 'es', controller, context, '🇪🇸'),
|
||||||
],
|
_buildLanguageButton(
|
||||||
|
'فارسی', 'fa', controller, context, '🇮🇷'),
|
||||||
|
_buildLanguageButton(
|
||||||
|
'中文', 'zh', controller, context, '🇨🇳'),
|
||||||
|
_buildLanguageButton(
|
||||||
|
'Русский', 'ru', controller, context, '🇷🇺'),
|
||||||
|
_buildLanguageButton(
|
||||||
|
'हिन्दी', 'hi', controller, context, '🇮🇳'),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -65,39 +73,28 @@ class Language extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildHeader() {
|
Widget _buildHeader() {
|
||||||
return Container(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.only(top: 20, bottom: 10),
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: const LinearGradient(
|
|
||||||
colors: [Color(0xFF2196F3), Color(0xFF1976D2)],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: CupertinoColors.systemBlue.withOpacity(0.2),
|
|
||||||
blurRadius: 10,
|
|
||||||
offset: const Offset(0, 4),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
|
||||||
CupertinoIcons.globe,
|
|
||||||
color: CupertinoColors.white,
|
|
||||||
size: 48,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Text(
|
Text(
|
||||||
'Choose Language'.tr,
|
'Language Options'.tr,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: CupertinoColors.white,
|
fontSize: 24,
|
||||||
fontSize: 22,
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
color: CupertinoColors.black, // Or your theme primary color
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.start,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
'Select your preferred language for the app interface.',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: CupertinoColors.secondaryLabel,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.start,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -105,28 +102,49 @@ class Language extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildLanguageButton(String title, String langCode,
|
Widget _buildLanguageButton(String title, String langCode,
|
||||||
LocaleController controller, BuildContext context) {
|
LocaleController controller, BuildContext context, String flagIcon) {
|
||||||
return Padding(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
decoration: BoxDecoration(
|
||||||
child: MyElevatedButton(
|
color: CupertinoColors.white,
|
||||||
title: title,
|
borderRadius: BorderRadius.circular(12),
|
||||||
onPressed: () async {
|
boxShadow: [
|
||||||
controller.changeLang(langCode);
|
BoxShadow(
|
||||||
showCupertinoDialog(
|
color: CupertinoColors.systemGrey5.withOpacity(0.5),
|
||||||
context: context,
|
spreadRadius: 1,
|
||||||
builder: (context) => CupertinoAlertDialog(
|
blurRadius: 3,
|
||||||
title: Text('You should restart app to change language'.tr),
|
offset: const Offset(0, 2),
|
||||||
actions: [
|
),
|
||||||
CupertinoDialogAction(
|
],
|
||||||
child: Text('Ok'.tr),
|
),
|
||||||
onPressed: () {
|
child: ListTile(
|
||||||
Get.offAll(() => MapPagePassenger());
|
leading: Text(flagIcon,
|
||||||
},
|
style: const TextStyle(fontSize: 28)), // Using flag icon as leading
|
||||||
),
|
title: Text(
|
||||||
],
|
title,
|
||||||
),
|
style: const TextStyle(
|
||||||
);
|
fontWeight: FontWeight.w500,
|
||||||
},
|
),
|
||||||
));
|
),
|
||||||
|
trailing: const Icon(CupertinoIcons.chevron_forward,
|
||||||
|
color: CupertinoColors.inactiveGray),
|
||||||
|
onTap: () async {
|
||||||
|
controller.changeLang(langCode);
|
||||||
|
showCupertinoDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => CupertinoAlertDialog(
|
||||||
|
title: Text('You should restart app to change language'.tr),
|
||||||
|
actions: [
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text('Ok'.tr),
|
||||||
|
onPressed: () {
|
||||||
|
Get.offAll(() => MapPagePassenger());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user