timezone_dropdown 1.0.4 copy "timezone_dropdown: ^1.0.4" to clipboard
timezone_dropdown: ^1.0.4 copied to clipboard

A dropdown widget contains all available timezones, by default the current device/browser timezone is identified and selected

Flutter TimezoneDropdown

Flutter simple and robust TimzeonDropdown with search feature, Place it anywhere you need to list all timezones and pick one.

Key FeaturesLicense

Key Features #

  • Automatic detection of device Timezone and set seleted as default

packages.yaml #

timezone_dropdown: <lastest version>

Import #

import 'package:timezone_dropdown/timezone_dropdown.dart';

Simple implementation #

import 'package:flutter/material.dart';
import 'package:timezone_dropdown/timezone_dropdown.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Timezone Dropdown',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Timezone Drop Down Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Container(
        child: TimezoneDropdown(
          hintText: 'Select Timezone',
          onTimezoneSelected: (timeZone) => print(timeZone),
        ),
      ),
    );
  }
}

License #

MIT

3
likes
130
pub points
57%
popularity

Publisher

verified publisherboodskap.io

A dropdown widget contains all available timezones, by default the current device/browser timezone is identified and selected

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dropdown_search, flutter, flutter_native_timezone, timezone

More

Packages that depend on timezone_dropdown