timezone_button_dropdown 1.0.2 copy "timezone_button_dropdown: ^1.0.2" to clipboard
timezone_button_dropdown: ^1.0.2 copied to clipboard

A dropdown widget contains all available timezones, user can place it anywhere they want and further customize the L&F

Flutter TimezoneDropdown

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

License

packages.yaml #

timezone_button_dropdown: <lastest version>

Import #

import 'package:timezone_button_dropdown/timezone_button_dropdown.dart';

Simple implementation #

import 'package:flutter/material.dart';
import 'package:timezone_button_dropdown/timezone_button_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(
          selectHint: 'Select Timezone',
          searchHint: 'Search Timezones...',
          selectedTimezone: null,
          onTimezoneSelected: (timeZone) => print(timeZone),
        ),
      ),
    );
  }
}

License #

MIT

9
likes
140
points
680
downloads

Publisher

verified publisherboodskap.io

Weekly Downloads

A dropdown widget contains all available timezones, user can place it anywhere they want and further customize the L&F

Documentation

API reference

License

MIT (license)

Dependencies

dropdown_button2, flutter

More

Packages that depend on timezone_button_dropdown