This commit is contained in:
Hamza-Ayed
2024-11-17 22:13:31 +02:00
parent e8c72d79a9
commit 5aeb3cf685
45 changed files with 856 additions and 284 deletions

View File

@@ -130,6 +130,8 @@ void main() async {
}
if (Platform.isAndroid || Platform.isIOS) {
NotificationController notificationController =
Get.put(NotificationController());
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
@@ -141,8 +143,7 @@ void main() async {
// if (Platform.isAndroid) {
// await Get.put(NotificationController()).initNotifications();
// }
NotificationController notificationController =
Get.put(NotificationController());
await notificationController.initNotifications();
// Generate a random index to pick a message
@@ -150,7 +151,7 @@ void main() async {
final randomMessage = driverMessages[random.nextInt(driverMessages.length)];
// Schedule the notification with the random message
notificationController.scheduleDailyNotifications(
notificationController.scheduleNotificationsForSevenDays(
randomMessage.split(':')[0],
randomMessage.split(':')[1],
"ding",