flutter_picker_plus library

A customizable picker widget library for Flutter applications.

Flutter Picker Plus provides a comprehensive and highly customizable picker widget that supports multiple data types, presentation modes, and extensive styling options. It's a continuation and enhancement of the original flutter_picker package.

Key Features

  • Multiple Data Sources: Support for arrays, numeric ranges, and date/time
  • Flexible Presentation: Modal, dialog, and bottom sheet display modes
  • Hierarchical Data: Multi-level selection with linked columns
  • Customization: Extensive styling, theming, and custom item builders
  • Internationalization: Built-in support for 20+ languages
  • Performance: Optimized scrolling with optional infinite looping

Quick Start

import 'package:flutter_picker_plus/flutter_picker_plus.dart';

// Simple string picker
final picker = Picker(
  adapter: PickerDataAdapter<String>(
    pickerData: ['Option 1', 'Option 2', 'Option 3'],
  ),
  onConfirm: (picker, selected) {
    print('Selected: ${picker.getSelectedValues()}');
  },
);

// Show the picker
picker.showModal<List<int>>(context);

Common Use Cases

Date and Time Selection

final datePicker = Picker(
  adapter: DateTimePickerAdapter(
    type: PickerDateTimeType.kYMD,
    value: DateTime.now(),
  ),
);

Numeric Range Selection

final numberPicker = Picker(
  adapter: NumberPickerAdapter(
    data: [
      NumberPickerColumn(begin: 1, end: 100), // 1-100
      NumberPickerColumn(begin: 0, end: 59),  // 0-59
    ],
  ),
);

Multi-Level Category Selection

final categoryPicker = Picker(
  adapter: PickerDataAdapter<String>(
    pickerData: [
      {
        'Electronics': ['Phone', 'Laptop', 'Tablet'],
        'Clothing': ['Shirt', 'Pants', 'Shoes'],
        'Books': ['Fiction', 'Science', 'History'],
      }
    ],
  ),
);

See also:

Classes

DateTimePickerAdapter
NumberPickerAdapter
NumberPickerColumn
Picker
A customizable picker widget for Flutter applications.
PickerAdapter<T>
Abstract base class for picker data adapters.
PickerDataAdapter<T>
A picker adapter for array-based and hierarchical data structures.
PickerDateTimeType
Picker DateTime Adapter Type
PickerDelimiter
A delimiter widget that can be inserted between picker columns.
PickerItem<T>
Represents a single item in a picker column with optional hierarchical children.
PickerLocalizations
localizations
PickerLocalizationsBase
PickerLocalizationsDelegate
picker localizations
PickerWidget<T>
PickerWidgetState<T>

Typedefs

PickerConfirmBeforeCallback = Future<bool> Function(Picker picker, List<int> selected)
Callback function that is called before confirming the picker selection.
PickerConfirmCallback = void Function(Picker picker, List<int> selected)
Callback function that is called when the picker selection is confirmed.
PickerItemBuilder = Widget? Function(BuildContext context, String? text, Widget? child, bool selected, int col, int index)
Builder function for customizing individual picker items.
PickerSelectedCallback = void Function(Picker picker, int index, List<int> selected)
Callback function that is called when a picker item is selected.
PickerValueFormat<T> = String Function(T value)
Callback function for formatting picker values to display strings.
PickerWidgetBuilder = Widget Function(BuildContext context, Widget pickerWidget)
Builder function for customizing the picker widget.