system_timezone 0.2.1+1 copy "system_timezone: ^0.2.1+1" to clipboard
system_timezone: ^0.2.1+1 copied to clipboard

FFI plugin to get IANA timezone

system_timezone #

The Motive #

I wanted to explore creating an FFI (Foreign Function Interface) plugin and also wanted to create a synchronous API to get the system timezone that supports all platforms.

Example #

Get current timezone

final currentTimezone = SystemTimezone.getTimezoneName();

Get list of known timezones

final listOfTimezones = SystemTimezone.getKnownTimezoneNames();

OS Constraints #

Credits #

  • The source code of flutter_timezone and iana-time-zone packages was instrumental in the development of this package.
  • UTM was invaluable for testing this package on Windows and Linux environments.