Form

Picker

A generic picker that allows an item to be selected. It is composed of one or more wheels, optionally with separators between those wheels. The picker supports arrow key navigation. Recommended for touch devices.

The picker supports arrow key navigation:

  • Up/Down arrows: Increment/decrement selected value
  • Left/Right arrows: Move between wheels

Recommended for touch devices.

CLI

To generate a specific style for customization:

dart run forui style create picker

Usage

FPicker(...)

1FPicker(
2 style: const .delta(spacing: 5),
3 children: [
4 FPickerWheel(children: [for (var i = 1; i <= 12; i++) Text('$i')]),
5 const Text(':'),
6 FPickerWheel(
7 children: [for (var i = 0; i < 60; i++) Text('$i'.padLeft(2, '0'))],
8 ),
9 ],
10 debugLabel: '',
11)

FPickerWheel(...)

1FPickerWheel(
2 loop: false,
3 flex: 1,
4 itemExtent: null,
5 children: [for (var i = 1; i <= 12; i++) Text('$i')],
6)

FPickerWheel.builder(...)

1FPickerWheel.builder(
2 flex: 1,
3 itemExtent: null,
4 builder: (context, index) => Text('$index'),
5)

Examples

Loop

Lazy

Multiple Wheels

With Separators

On this page