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

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

example/lib/main.dart

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),
        ),
      ),
    );
  }
}
5
likes
140
points
345
downloads

Publisher

verified publisherboodskap.io

Weekly Downloads

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

Documentation

API reference

License

MIT (license)

Dependencies

dropdown_search, flutter, timezone

More

Packages that depend on timezone_dropdown