11/11/1
This commit is contained in:
@@ -85,6 +85,8 @@ import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:timezone/data/latest.dart' as tz;
|
||||
import 'package:timezone/timezone.dart' as tz;
|
||||
|
||||
import '../../print.dart';
|
||||
|
||||
class NotificationController extends GetxController {
|
||||
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
@@ -185,13 +187,16 @@ class NotificationController extends GetxController {
|
||||
// Initialize and set Cairo timezone
|
||||
tz.initializeTimeZones();
|
||||
var cairoLocation;
|
||||
if (box.read(BoxName.countryCode).toString() == 'Egypt') {
|
||||
cairoLocation = tz.getLocation('Africa/Cairo');
|
||||
} else {} // todo get for location country
|
||||
// if (box.read(BoxName.countryCode).toString() == 'Egypt') {
|
||||
cairoLocation = tz.getLocation('Africa/Cairo');
|
||||
// } else {
|
||||
// cairoLocation = tz.getLocation('UTC');
|
||||
// } // todo get for location country
|
||||
// Set Cairo timezone
|
||||
|
||||
Log.print('cairoLocation: ${cairoLocation}');
|
||||
final now = tz.TZDateTime.now(
|
||||
cairoLocation); // Use Cairo timezone for the current time
|
||||
|
||||
tz.TZDateTime scheduledDate = tz.TZDateTime(
|
||||
cairoLocation, now.year, now.month, now.day, hour, minute);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user