tjarvstrand / flutter_timezone

A fork of https://github.com/pinkfish/flutter_native_timezone
Apache License 2.0
42 stars 29 forks source link

[FIX] get list of timezones on Web #34

Closed HosamHasanRamadan closed 1 month ago

HosamHasanRamadan commented 2 months ago

On web getAvailableTimezones returns the same result as getLocalTimezone. This PR fixes this issue

image

tjarvstrand commented 2 months ago

Nice, thanks! This looks good but looking at browser compatibility this will limit the compatibility of this plugin to browsers released within the last two years or so.

Is there any way we could do something lie this to check if supportedValuesOf is available before calling it?

HosamHasanRamadan commented 2 months ago

@tjarvstrand I changed the code a little bit to fallback to old behavior if supportedValuesOf is not supported on current browser

tjarvstrand commented 1 month ago

Sorry for the delay, I had to take the time to download an older browser version.

LGTM, thanks for the contribution! ❤️

tjarvstrand commented 1 month ago

This fix is now available in the 3.0.0 version on pub.dev