24-12/31/1

This commit is contained in:
Hamza-Ayed
2024-12-31 21:26:03 +03:00
parent 651df6b897
commit 200284a71a
9 changed files with 5334 additions and 2265 deletions

View File

@@ -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 = 111 versionCode = 112
versionName = '1.6.111' versionName = '1.6.112'
multiDexEnabled =true multiDexEnabled =true
// manifestPlaceholders can be specified here if needed // manifestPlaceholders can be specified here if needed

View File

@@ -41,11 +41,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>80</string> <string>82</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>4.3.80</string> <string>4.3.82</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string></string> <string></string>
<key>FirebaseAppDelegateProxyEnabled</key> <key>FirebaseAppDelegateProxyEnabled</key>

View File

@@ -125,10 +125,10 @@ class FirebaseMessagesController extends GetxController {
notificationController.showNotification( notificationController.showNotification(
'Order', message.notification!.body!, 'Order'); 'Order', message.notification!.body!, 'Order');
} }
} else if (message.notification!.title! == 'Accepted Ride') { } else if (message.notification!.title! == 'Accepted Ride'.tr) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
notificationController.showNotification( notificationController.showNotification(
'Apply Order'.tr, 'Driver Applied the Ride for You'.tr, 'ding'); 'Accepted Ride'.tr, 'Driver Accepted the Ride for You'.tr, 'ding');
} }
var passengerList = message.data['passengerList']; var passengerList = message.data['passengerList'];

View File

@@ -1956,8 +1956,8 @@ class MapPassengerController extends GetxController {
final body = constructNotificationBody(driverData); final body = constructNotificationBody(driverData);
// Log.print('body:ww ${body}'); // Log.print('body:ww ${body}');
FirebaseMessagesController().sendNotificationToDriverMAP( FirebaseMessagesController().sendNotificationToDriverMAP(
'OrderSpeed', 'Order'.tr,
rideId, endNameAddress,
driverData['token'].toString(), driverData['token'].toString(),
body, body,
'order.wav'); 'order.wav');

File diff suppressed because it is too large Load Diff

View File

@@ -33,11 +33,12 @@ class MapPagePassenger extends StatelessWidget {
Get.put(MapPassengerController()); Get.put(MapPassengerController());
Get.put(MyMenuController()); Get.put(MyMenuController());
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
// checkForUpdate(context); checkForUpdate(context);
}); });
return Scaffold( return Scaffold(
body: SafeArea( body: SafeArea(
bottom: false,
child: Stack( child: Stack(
children: [ children: [
GoogleMapPassengerWidget(), GoogleMapPassengerWidget(),

View File

@@ -102,7 +102,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
mapPassengerController.isBottomSheetShown && mapPassengerController.isBottomSheetShown &&
mapPassengerController.rideConfirm == false mapPassengerController.rideConfirm == false
? Positioned( ? Positioned(
bottom: 15, bottom: 30,
left: 8, left: 8,
right: 8, right: 8,
child: Container( child: Container(
@@ -487,23 +487,29 @@ class PromoCode extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Get.defaultDialog( Get.defaultDialog(
title: 'Apply Promo Code'.tr, // More engaging title titlePadding:
content: Padding( const EdgeInsets.only(top: 20, bottom: 10),
padding: const EdgeInsets.symmetric(vertical: 16), contentPadding: const EdgeInsets.symmetric(
child: Form( horizontal: 20, vertical: 15),
key: mapPassengerController.promoFormKey, title: 'Apply Promo Code'.tr,
child: MyTextForm( titleStyle: Get.textTheme
controller: mapPassengerController.promo, .headlineMedium, // Make title more prominent
label: 'Promo Code'.tr, // Shortened label content: Form(
hint: 'Enter your promo code' key: mapPassengerController.promoFormKey,
.tr, // More friendly hint child: Column(
type: TextInputType.name, children: [
// style: AppStyle.normalTextBlack, // Apply consistent style MyTextForm(
), controller: mapPassengerController.promo,
label: 'Promo Code'.tr,
hint: 'Enter your promo code'.tr,
type: TextInputType.text,
),
const SizedBox(height: 16), // Add some spacing
],
), ),
), ),
confirm: MyElevatedButton( confirm: MyElevatedButton(
title: 'Apply'.tr, // Shortened button title title: 'Apply'.tr,
onPressed: () { onPressed: () {
if (mapPassengerController if (mapPassengerController
.promoFormKey.currentState! .promoFormKey.currentState!
@@ -518,6 +524,10 @@ class PromoCode extends StatelessWidget {
onPressed: () => Get.back(), onPressed: () => Get.back(),
child: Text('Cancel'.tr), child: Text('Cancel'.tr),
), ),
// Customize the shape and background color for a better look
backgroundColor: Theme.of(context)
.cardColor, // Use card color for consistency
radius: 10,
); );
}, },
child: Container( child: Container(

View File

@@ -13,116 +13,97 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
Get.put(TextToSpeechController()); Get.put(TextToSpeechController());
return GetBuilder<MapPassengerController>( return GetBuilder<MapPassengerController>(
builder: (controller) => Positioned( builder: (controller) => Positioned(
top: Get.height * .008, top: Get.height * .008,
left: Get.width * .2, left: Get.width * .02, // Adjust left position for better spacing
child: Builder(builder: (context) { child: Row(
return Row( mainAxisAlignment:
children: [ MainAxisAlignment.spaceAround, // Distribute space evenly
AnimatedContainer( children: [
duration: const Duration(microseconds: 200), _buildIconButtonWithAnimation(
width: controller.widthMapTypeAndTraffic, controller: controller,
decoration: BoxDecoration( icon: Icons.satellite_alt,
border: Border.all(), onPressed: () => controller.changeMapType(),
color: AppColor.secondaryColor, tooltip: 'Toggle Map Type', // Add tooltips for better UX
borderRadius: BorderRadius.circular(15)), ),
child: IconButton( const SizedBox(width: 8), // Consistent spacing
onPressed: () { _buildIconButtonWithAnimation(
controller.changeMapType(); controller: controller,
// Toast.show(context, 'This is a toast message!'); icon: Icons.streetview_sharp,
}, onPressed: () => controller.changeMapTraffic(),
icon: const Icon( tooltip: 'Toggle Traffic',
Icons.satellite_alt, ),
size: 29, const SizedBox(width: 8),
_buildIconButtonWithAnimation(
controller: controller,
icon: Icons.location_on,
onPressed: () {
controller.mapController?.animateCamera(
CameraUpdate.newLatLng(
LatLng(
controller.passengerLocation.latitude,
controller.passengerLocation.longitude,
), ),
), ),
), );
const SizedBox( },
width: 5, tooltip: 'Go to My Location',
), ),
AnimatedContainer( const SizedBox(width: 8),
duration: const Duration(microseconds: 200), _buildIconButtonWithAnimation(
width: controller.widthMapTypeAndTraffic, controller: controller,
decoration: BoxDecoration( icon: Octicons.watch,
color: AppColor.secondaryColor, onPressed: () => Get.to(() => VipWaittingPage()),
border: Border.all(), tooltip: 'VIP Waiting Page', // More descriptive tooltip
borderRadius: BorderRadius.circular(15)), ),
child: IconButton( // const SizedBox(width: 8),
onPressed: () { // _buildIconButtonWithAnimation(
controller.changeMapTraffic(); // controller: controller,
// Toast.show(context, 'This is a toast message!'); // icon: Octicons.telescope,
}, // onPressed: () async {
icon: const Icon( // final result = await sql.getCustomQuery('''
Icons.streetview_sharp, // SELECT * FROM ${TableName.recentLocations} ORDER BY createdAt DESC
size: 29, // ''');
), // },
), // tooltip: 'Recent Locations', // More descriptive tooltip
), // ),
const SizedBox( ],
width: 5, ),
), ),
// if (Platform.isIOS) );
AnimatedContainer( }
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic, Widget _buildIconButtonWithAnimation({
decoration: BoxDecoration( required MapPassengerController controller,
color: AppColor.secondaryColor, required IconData icon,
border: Border.all(), required VoidCallback onPressed,
borderRadius: BorderRadius.circular(15)), String? tooltip,
child: IconButton( }) {
onPressed: () { return AnimatedContainer(
controller.mapController?.animateCamera( duration: const Duration(milliseconds: 200),
CameraUpdate.newLatLng(LatLng( width: controller.widthMapTypeAndTraffic,
controller.passengerLocation.latitude, decoration: BoxDecoration(
controller.passengerLocation.longitude))); color: AppColor.primaryColor,
}, border: Border.all(color: Colors.grey.shade400), // More subtle border
icon: const Icon( borderRadius: BorderRadius.circular(12), // Slightly less rounded
Icons.location_on, boxShadow: [
size: 29, // Add a subtle shadow for depth
), BoxShadow(
), color: Colors.black.withOpacity(0.1),
), spreadRadius: 0.5,
const SizedBox( blurRadius: 3,
width: 5, offset: const Offset(0, 1),
), ),
AnimatedContainer( ],
duration: const Duration(microseconds: 200), ),
width: controller.widthMapTypeAndTraffic, child: IconButton(
decoration: BoxDecoration( onPressed: onPressed,
color: AppColor.secondaryColor, icon: Icon(
border: Border.all(), icon,
borderRadius: BorderRadius.circular(15)), size: 24, // Slightly smaller icon for a cleaner look
child: IconButton( color: Colors.white, // Ensure good contrast
onPressed: () async { ),
Get.to(() => VipWaittingPage()); tooltip: tooltip,
}, splashRadius: 24, // Adjust splash radius for better feedback
icon: const Icon( ),
Octicons.watch, // Replace this with your desired VIP icon
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 {
// final result = await sql.getCustomQuery('''
// SELECT * FROM ${TableName.recentLocations} ORDER BY createdAt DESC
// ''');
// },
// icon: const Icon(
// Octicons
// .telescope, // Replace this with your desired VIP icon
// size: 29,
// ),
// ),
// ),
],
);
})),
); );
} }

View File

@@ -26,7 +26,7 @@ class MainBottomMenuMap extends StatelessWidget {
Get.put(MapPassengerController()); Get.put(MapPassengerController());
return GetBuilder<MapPassengerController>( return GetBuilder<MapPassengerController>(
builder: (controller) => Positioned( builder: (controller) => Positioned(
bottom: 16, // Increased bottom padding bottom: Get.height * .04, // Increased bottom padding
left: 16, left: 16,
right: 16, right: 16,
child: GestureDetector( child: GestureDetector(
@@ -104,24 +104,26 @@ class MainBottomMenuMap extends StatelessWidget {
), ),
), ),
), ),
const SizedBox(height: 12), const SizedBox(height: 8),
if (controller.recentPlaces.isNotEmpty) if (controller.recentPlaces.isNotEmpty)
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('Recent Places'.tr, style: AppStyle.subtitle), // Text('Recent Places'.tr, style: AppStyle.subtitle),
SizedBox( SizedBox(
height: 60, height: 30,
child: ListView.separated( child: Center(
scrollDirection: Axis.horizontal, child: ListView.separated(
itemCount: controller.recentPlaces.length, scrollDirection: Axis.horizontal,
separatorBuilder: (context, index) => itemCount: controller.recentPlaces.length,
const SizedBox(width: 8), separatorBuilder: (context, index) =>
itemBuilder: (context, index) => const SizedBox(width: 8),
_buildRecentPlaceButton( itemBuilder: (context, index) =>
controller, context, index), _buildRecentPlaceButton(
controller, context, index),
),
), ),
), ),
], ],
@@ -308,23 +310,17 @@ class MainBottomMenuMap extends StatelessWidget {
}, },
); );
}, },
child: Chip( child: Container(
label: Text(controller.recentPlaces[index]['name'], decoration: BoxDecoration(
color: AppColor.primaryColor.withOpacity(0.05), // Subtle background
borderRadius: BorderRadius.circular(12),
border: Border(
bottom: BorderSide(
color: AppColor.primaryColor.withOpacity(0.1), width: 1),
),
),
child: Text(controller.recentPlaces[index]['name'],
style: const TextStyle(fontSize: 14)), style: const TextStyle(fontSize: 14)),
onDeleted: () {
MyDialog().getDialog(
"Are you sure to delete this location?".tr,
'',
() {
sql.deleteData(TableName.recentLocations,
controller.recentPlaces[index]['id']);
controller.getFavioratePlaces();
controller.update();
Get.back();
mySnackbarSuccess('deleted'.tr);
},
);
},
), ),
); );
} }
@@ -463,16 +459,16 @@ class MainBottomMenuMap extends StatelessWidget {
children: [ children: [
Text('${'Where to'.tr} ${box.read(BoxName.name)}', Text('${'Where to'.tr} ${box.read(BoxName.name)}',
style: AppStyle.subtitle), style: AppStyle.subtitle),
if (controller.noCarString) // if (controller.noCarString)
Text('Nearest Car: ~'.tr, // Text('Nearest Car: ~'.tr,
style: TextStyle(color: Colors.grey.shade600)) // style: TextStyle(color: Colors.grey.shade600))
else // else
Text( Text(
controller.nearestCar != null controller.nearestCar != null
? 'Nearest Car: ${controller.nearestDistance.toStringAsFixed(0)} m' ? 'Nearest Car: ${controller.nearestDistance.toStringAsFixed(0)} m'
: 'No cars nearby'.tr, : 'No cars nearby'.tr,
style: TextStyle(color: Colors.grey.shade600), style: TextStyle(color: Colors.grey.shade600),
), ),
], ],
), ),
], ],