Skip to content
pubscout

flutter_timezone

5.1.1, released 7 weeks ago by wolverinebeach.net

A flutter plugin for getting the local timezone of the device.

WASM-readyRock solid
$ flutter pub add flutter_timezone
Source repository

What it does

Provides a simple mechanism to fetch the local timezone of the device's operating system. On supported platforms, it returns timezone information containing both the timezone name and localized timezone name.

AI-written summary of version 5.1.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to know the user's local timezone for date and time calculations.
  • You are building a cross-platform Flutter app supporting Android, iOS, web, Windows, macOS, or Linux.

Skip it when

  • You require complex timezone database management or conversions that are handled by dedicated timezone libraries without needing system lookups.

Strengths

  • Supports multiple platforms including Android, iOS, web, Windows, macOS, and Linux.
  • Provides localized timezone names on Android, macOS, and iOS.

Weaknesses

  • Localized timezone names are only supported on a subset of platforms.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
2

Install the package and use it directly. Specific platforms like Android may require minimum Java versions as noted in breaking changes.

final TimezoneInfo currentTimeZone = await FlutterTimezone.getLocalTimezone();

Alternatives

Packages that do the same job and could replace flutter_timezone.

Works with

Packages commonly used together with flutter_timezone: ones it builds on, ones built on it, and its own family.