FlutterTimezoneObserverWeb constructor

FlutterTimezoneObserverWeb({
  1. Duration pollInterval = _defaultPollInterval,
  2. String timezoneReader()?,
})

Creates a web implementation of FlutterTimezoneObserverPlatform.

pollInterval controls how often the browser is polled for a new timezone while the page is visible. Pass Duration.zero to disable polling entirely and rely on visibility and focus events only.

timezoneReader overrides how the timezone is read. It is meant for tests; production code should leave it null.

Implementation

FlutterTimezoneObserverWeb({
  Duration pollInterval = _defaultPollInterval,
  String Function()? timezoneReader,
}) : _pollInterval = pollInterval,
     _readTimezone = timezoneReader ?? _readBrowserTimezone;