platformTimezoneProvider property

String Function() platformTimezoneProvider
getter/setter pair

A callback that retrieves the platform's timezone.

A TZ database timezone identifier such as Asia/Singapore is always returned. Otherwise returns Factory if the platform's timezone could not be retrieved.

It may be replaced to change timezone retrieval.

Retrieving a timezone directly from this callback is discouraged. Users should prefer Timezone.now.

See defaultPlatformTimezoneProvider for the default implementation.

Implementation

static String Function() platformTimezoneProvider = defaultPlatformTimezoneProvider;