fix marker rendering & modernize riding widgets for dark mode - 2026-04-11
This commit is contained in:
@@ -75,7 +75,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
// 🔹 الاشتراك في topic
|
||||
await fcmToken
|
||||
.subscribeToTopic("passengers"); // أو "users" حسب نوع المستخدم
|
||||
print("Subscribed to 'passengers' topic ✅");
|
||||
Log.print("Subscribed to 'passengers' topic ✅");
|
||||
|
||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||
// If the app is in the background or terminated, show a system tray message
|
||||
@@ -132,7 +132,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
// 🔥 فك التشفير: تحويل الـ String إلى Map
|
||||
driverInfoMap = jsonDecode(rawJson);
|
||||
} catch (e) {
|
||||
print("❌ Error decoding FCM driver_info: $e");
|
||||
Log.print("❌ Error decoding FCM driver_info: $e");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
try {
|
||||
driverList = jsonDecode(rawData) as List<dynamic>;
|
||||
} catch (e) {
|
||||
print("❌ Error decoding DriverList: $e");
|
||||
Log.print("❌ Error decoding DriverList: $e");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
// // token: driverList[0].toString(),
|
||||
// // remoteID: driverList[2].toString(),
|
||||
// // ));
|
||||
// } catch (e) {}
|
||||
// } catch (e) { Log.print("Error occurred: $e"); }
|
||||
// } else if (message.notification!.title! == 'Call Income from Driver'.tr) {
|
||||
// try {
|
||||
// var myListString = message.data['DriverList'];
|
||||
@@ -504,7 +504,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
// // token: driverList[0].toString(),
|
||||
// // remoteID: driverList[2].toString(),
|
||||
// // ));
|
||||
// } catch (e) {}
|
||||
// } catch (e) { Log.print("Error occurred: $e"); }
|
||||
// } else if (message.notification!.title! == 'Call End'.tr) {
|
||||
// try {
|
||||
// var myListString = message.data['DriverList'];
|
||||
@@ -518,7 +518,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
// }
|
||||
// // Assuming GetMaterialApp is initialized and context is valid for navigation
|
||||
// // Get.off(const CallPage());
|
||||
// } catch (e) {}
|
||||
// } catch (e) { Log.print("Error occurred: $e"); }
|
||||
// } else if (message.notification!.title! == 'Driver Cancelled Your Trip') {
|
||||
// // Get.snackbar(
|
||||
// // 'You will be pay the cost to driver or we will get it from you on next trip'
|
||||
@@ -569,13 +569,13 @@ class FirebaseMessagesController extends GetxController {
|
||||
snackPosition: SnackPosition.TOP,
|
||||
titleText: Text(
|
||||
'Applied'.tr,
|
||||
style: const TextStyle(color: AppColor.redColor),
|
||||
style: TextStyle(color: AppColor.redColor),
|
||||
),
|
||||
messageText: Text(
|
||||
'Driver Applied the Ride for You'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
icon: const Icon(Icons.approval),
|
||||
icon: Icon(Icons.approval, color: AppColor.primaryColor),
|
||||
shouldIconPulse: true,
|
||||
margin: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
@@ -659,7 +659,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
Toast.show(
|
||||
context,
|
||||
'${'Tip is '.tr}${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.blueColor);
|
||||
AppColor.cyanBlue);
|
||||
controller.update();
|
||||
},
|
||||
child: Container(
|
||||
@@ -678,7 +678,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
Toast.show(
|
||||
context,
|
||||
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.blueColor);
|
||||
AppColor.cyanBlue);
|
||||
controller.update();
|
||||
},
|
||||
child: Container(
|
||||
@@ -697,7 +697,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
Toast.show(
|
||||
context,
|
||||
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.blueColor);
|
||||
AppColor.cyanBlue);
|
||||
controller.update();
|
||||
},
|
||||
child: Container(
|
||||
@@ -716,7 +716,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
Toast.show(
|
||||
context,
|
||||
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.blueColor);
|
||||
AppColor.cyanBlue);
|
||||
controller.update();
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:Intaleq/print.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
@@ -13,7 +14,7 @@ class _LiveActivityScreenState extends State<LiveActivityScreen> {
|
||||
try {
|
||||
await platform.invokeMethod('startLiveActivity');
|
||||
} on PlatformException catch (e) {
|
||||
print("Failed to start Live Activity: '${e.message}'.");
|
||||
Log.print("Failed to start Live Activity: '${e.message}'.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +22,7 @@ class _LiveActivityScreenState extends State<LiveActivityScreen> {
|
||||
try {
|
||||
await platform.invokeMethod('updateLiveActivity', {"progress": progress});
|
||||
} on PlatformException catch (e) {
|
||||
print("Failed to update Live Activity: '${e.message}'.");
|
||||
Log.print("Failed to update Live Activity: '${e.message}'.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +30,7 @@ class _LiveActivityScreenState extends State<LiveActivityScreen> {
|
||||
try {
|
||||
await platform.invokeMethod('endLiveActivity');
|
||||
} on PlatformException catch (e) {
|
||||
print("Failed to end Live Activity: '${e.message}'.");
|
||||
Log.print("Failed to end Live Activity: '${e.message}'.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,4 +57,4 @@ class _LiveActivityScreenState extends State<LiveActivityScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:Intaleq/print.dart';
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
@@ -38,7 +39,7 @@ class NotificationController extends GetxController {
|
||||
settings: initializationSettings);
|
||||
|
||||
tz.initializeTimeZones();
|
||||
print('Notifications initialized');
|
||||
Log.print('Notifications initialized');
|
||||
}
|
||||
|
||||
// Displays a notification with the given title and message
|
||||
@@ -63,7 +64,7 @@ class NotificationController extends GetxController {
|
||||
NotificationDetails(android: android, iOS: ios);
|
||||
await _flutterLocalNotificationsPlugin.show(
|
||||
id: 0, title: title, body: message, notificationDetails: details);
|
||||
print('Notification shown: $title - $message');
|
||||
Log.print('Notification shown: $title - $message');
|
||||
}
|
||||
// /Users/hamzaaleghwairyeen/development/App/ride 2/lib/controller/firebase/local_notification.dart
|
||||
|
||||
@@ -93,9 +94,9 @@ class NotificationController extends GetxController {
|
||||
// if (Platform.isAndroid) {
|
||||
// if (await Permission.scheduleExactAlarm.isDenied) {
|
||||
// if (await Permission.scheduleExactAlarm.request().isGranted) {
|
||||
// print('SCHEDULE_EXACT_ALARM permission granted');
|
||||
// Log.print('SCHEDULE_EXACT_ALARM permission granted');
|
||||
// } else {
|
||||
// print('SCHEDULE_EXACT_ALARM permission denied');
|
||||
// Log.print('SCHEDULE_EXACT_ALARM permission denied');
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
@@ -116,7 +117,7 @@ class NotificationController extends GetxController {
|
||||
// day, 20, 0, title, message, details, day * 1000 + 3); // Unique ID
|
||||
// }
|
||||
|
||||
// print('Notifications scheduled successfully for the next 7 days');
|
||||
// Log.print('Notifications scheduled successfully for the next 7 days');
|
||||
// }
|
||||
void scheduleNotificationsForSevenDays(
|
||||
String title, String message, String tone) async {
|
||||
@@ -142,9 +143,9 @@ class NotificationController extends GetxController {
|
||||
if (Platform.isAndroid) {
|
||||
if (await Permission.scheduleExactAlarm.isDenied) {
|
||||
if (await Permission.scheduleExactAlarm.request().isGranted) {
|
||||
print('SCHEDULE_EXACT_ALARM permission granted');
|
||||
Log.print('SCHEDULE_EXACT_ALARM permission granted');
|
||||
} else {
|
||||
print('SCHEDULE_EXACT_ALARM permission denied');
|
||||
Log.print('SCHEDULE_EXACT_ALARM permission denied');
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -180,12 +181,12 @@ class NotificationController extends GetxController {
|
||||
// Mark this notification ID as scheduled in GetStorage
|
||||
box.write('notification_$notificationId', true);
|
||||
} else {
|
||||
print('Notification with ID $notificationId is already scheduled.');
|
||||
Log.print('Notification with ID $notificationId is already scheduled.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print('Notifications scheduled successfully for the next 7 days');
|
||||
Log.print('Notifications scheduled successfully for the next 7 days');
|
||||
}
|
||||
|
||||
void scheduleNotificationsForTimeSelected(
|
||||
@@ -212,9 +213,9 @@ class NotificationController extends GetxController {
|
||||
if (Platform.isAndroid) {
|
||||
if (await Permission.scheduleExactAlarm.isDenied) {
|
||||
if (await Permission.scheduleExactAlarm.request().isGranted) {
|
||||
print('SCHEDULE_EXACT_ALARM permission granted');
|
||||
Log.print('SCHEDULE_EXACT_ALARM permission granted');
|
||||
} else {
|
||||
print('SCHEDULE_EXACT_ALARM permission denied');
|
||||
Log.print('SCHEDULE_EXACT_ALARM permission denied');
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -237,7 +238,7 @@ class NotificationController extends GetxController {
|
||||
2, // Unique ID for 30-minute before notification
|
||||
);
|
||||
|
||||
print('Notifications scheduled successfully for the time selected');
|
||||
Log.print('Notifications scheduled successfully for the time selected');
|
||||
}
|
||||
|
||||
Future<void> _scheduleNotificationForTimeVIP(
|
||||
@@ -262,13 +263,13 @@ class NotificationController extends GetxController {
|
||||
.subtract(const Duration(minutes: 10))
|
||||
.isBefore(now)) {
|
||||
// If the 10 minutes before the scheduled time is in the past, don't schedule
|
||||
print(
|
||||
Log.print(
|
||||
'Scheduled time minus 10 minutes is in the past. Skipping notification.');
|
||||
return; // Skip this notification
|
||||
}
|
||||
|
||||
print('Current time (Cairo): $now');
|
||||
print('Scheduling notification for: $scheduledTZDateTime');
|
||||
Log.print('Current time (Cairo): $now');
|
||||
Log.print('Scheduling notification for: $scheduledTZDateTime');
|
||||
|
||||
await _flutterLocalNotificationsPlugin.zonedSchedule(
|
||||
id: notificationId, // Unique ID for each notification
|
||||
@@ -283,7 +284,7 @@ class NotificationController extends GetxController {
|
||||
null, // Don't repeat automatically; we handle manually
|
||||
);
|
||||
|
||||
print('Notification scheduled successfully for: $scheduledTZDateTime');
|
||||
Log.print('Notification scheduled successfully for: $scheduledTZDateTime');
|
||||
}
|
||||
|
||||
Future<void> _scheduleNotificationForTime(
|
||||
@@ -314,8 +315,8 @@ class NotificationController extends GetxController {
|
||||
scheduledDate = scheduledDate.add(const Duration(days: 1));
|
||||
}
|
||||
|
||||
print('Current time (Cairo): $now');
|
||||
print('Scheduling notification for: $scheduledDate');
|
||||
Log.print('Current time (Cairo): $now');
|
||||
Log.print('Scheduling notification for: $scheduledDate');
|
||||
|
||||
await _flutterLocalNotificationsPlugin.zonedSchedule(
|
||||
id: notificationId, // Unique ID for each notification
|
||||
@@ -330,6 +331,6 @@ class NotificationController extends GetxController {
|
||||
null, // Don't repeat automatically; we handle 7 days manually
|
||||
);
|
||||
|
||||
print('Notification scheduled successfully for: $scheduledDate');
|
||||
Log.print('Notification scheduled successfully for: $scheduledDate');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:get/get.dart'; // للترجمة .tr
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../print.dart'; // للترجمة .tr
|
||||
|
||||
class NotificationService {
|
||||
static const String _serverUrl =
|
||||
@@ -50,14 +52,15 @@ class NotificationService {
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
print('✅ Notification sent successfully.');
|
||||
// print('Response: ${response.body}');
|
||||
Log.print('✅ Notification sent successfully.');
|
||||
// Log.print('Response: ${response.body}');
|
||||
} else {
|
||||
print('❌ Failed to send notification. Code: ${response.statusCode}');
|
||||
print('Error Body: ${response.body}');
|
||||
Log.print(
|
||||
'❌ Failed to send notification. Code: ${response.statusCode}');
|
||||
Log.print('Error Body: ${response.body}');
|
||||
}
|
||||
} catch (e) {
|
||||
print('❌ Error sending notification: $e');
|
||||
Log.print('❌ Error sending notification: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user