single_option_picker 1.0.1+2 copy "single_option_picker: ^1.0.1+2" to clipboard
single_option_picker: ^1.0.1+2 copied to clipboard

SingleOptionPicker is a widget to easily manage especially forms that have a single choice picker. Things like locale, configs are great examples.

Buy Me A Coffee

Introduction #

Have you ever wanted a widget that facilitates the process of choosing an option among some available options? If yes, single_option_picker is the widget for you :)

Basic Usage #

The widget is very simple to use. You need to pass the number of options, an option builder (that will build the options), a callback when an option is picked and you need to tell what is the selected option index.

SingleOptionPicker(
    numberOfOptions: 3,
    optionBuilder: (index, isSelected) => Container(
        height: 80,
        child: Center(
            child: Icon(
                getIcon(index),
                color: isSelected ? getIconColor(index) : Colors.black,
            ),
        ),
    ),
    onChangeOption: (index) {
        setState(() {
            selectedIndex = index;
        });
    },
    selectedOptionIndex: selectedIndex,
)

The great is that the OptionBuilder makes you free to implement your options by yourself. You can implement Icons, Containers, etc.

enter image description here

Suggestions & Bugs #

For any suggestions or bug report please head to issue tracker.

4
likes
140
pub points
61%
popularity

Publisher

verified publisherrodrigobastos.dev

SingleOptionPicker is a widget to easily manage especially forms that have a single choice picker. Things like locale, configs are great examples.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on single_option_picker