i need to create local notification for scheduling, the issue is when i use setLocalLocation function to get the time zone name which equals [log] timeZoneName value is =>GMT
.
the exception is:
LocationNotFoundException (Location with the name "GMT" doesn't exist)
the main function:
const MethodChannel platform = MethodChannel('dexterx.dev/example_app');
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await _configureLocalTimeZone();
runApp(MyApp());
}
_configureLocalTimeZone function:
Future<void> _configureLocalTimeZone() async {
tz.initializeTimeZones();
final String timeZoneName = await platform.invokeMethod('getTimeZoneName');
log("timeZoneName value is =>$timeZoneName",error: {"name":"Value or not"});
tz.setLocalLocation(tz.getLocation(timeZoneName));
}