dropdown_wheel_picker 0.2.0 copy "dropdown_wheel_picker: ^0.2.0" to clipboard
dropdown_wheel_picker: ^0.2.0 copied to clipboard

Flutter package for dropdown scrollable wheel picker. Support many use cases incl. multi-cols items, date, time, distance.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
            seedColor: const Color.fromARGB(255, 62, 58, 69)),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: SafeArea(
      child: Padding(
          padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 8),
          child: SingleChildScrollView(
            child: Column(
              children: [
                DropdownItemPicker(
                  pickerTitle: const Text('Countries'),
                  items: const [
                    Text('China πŸ‡¨πŸ‡³'),
                    Text('France πŸ‡«πŸ‡·'),
                    Text('Russia πŸ‡·πŸ‡Ί'),
                    Text('United Kingdom πŸ‡¬πŸ‡§'),
                    Text('United States πŸ‡ΊπŸ‡Έ'),
                  ],
                  onChanged: (value) => print('Selected Country: $value'),
                ),
                const SizedBox(height: 16),
                DropdownMultiColItemPicker(
                  pickerTitle: const Text('Star Wars'),
                  multiColItems: const [
                    [
                      Text('Jedi'),
                      Text('Empire'),
                    ],
                    [
                      Text('Luke'),
                      Text('Anakin'),
                      Text('Obi-Wan'),
                      Text('Han Solo'),
                      Text('Palpatine'),
                    ]
                  ],
                  onChanged: (value) => print('Selected Countries: $value'),
                ),
                const SizedBox(height: 16),
                DropdownDatePicker(
                  pickerTitle: const Text('Date Picker'),
                  initialDate: DateTime(2024, 1, 1),
                  onChanged: (value) => print('Selected Date: $value'),
                ),
                const SizedBox(height: 16),
                DropdownDistancePicker(
                  pickerTitle: const Text('Distance Picker'),
                  initialDistance: Length(2.5, 'mi'),
                  onChanged: (value) => print('${value.value} ${value.unit}'),
                ),
                const SizedBox(height: 16),
                DropdownTimePicker(
                  pickerTitle: const Text('Time Picker'),
                  initialTime:
                      const Duration(hours: 2, minutes: 0, seconds: 35),
                  onChanged: (value) => print(value),
                ),
                const SizedBox(height: 16),
                DropdownPacePicker(
                  pickerTitle: const Text('Pace Picker'),
                  initialPace:
                      Pace(const Duration(minutes: 6, seconds: 20), '/mi'),
                  onChanged: (value) => print(value),
                ),
                const SizedBox(height: 16),
                DropdownHeightPicker(
                    pickerTitle: const Text('height'),
                    initialHeight: Length(70, 'in'),
                    onChanged: (value) => print(value)),
                const SizedBox(height: 16),
                DropdownWeightPicker(
                    pickerTitle: const Text('Weight'),
                    initialWieght: Mass(150, 'lb'),
                    onChanged: (value) => print(value)),
                const SizedBox(height: 16),
                DropdownCountryPicker(
                  pickerTitle: const Text('Country'),
                  scrollWheelHeight: 120,
                  onChanged: (value) => print(value),
                ),
              ],
            ),
          )),
    ));
  }
}
2
likes
160
points
52
downloads

Publisher

verified publisherfanjin.org

Weekly Downloads

Flutter package for dropdown scrollable wheel picker. Support many use cases incl. multi-cols items, date, time, distance.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on dropdown_wheel_picker