dropdown_container 0.0.2 copy "dropdown_container: ^0.0.2" to clipboard
dropdown_container: ^0.0.2 copied to clipboard

A container provides dropdown for its child widget. The child widget and the widget in dropdown is not limited.

DropdownContainer is used to provide a dropdown for its child.

Features #

There is no limit for the dropdown widget and child widget.

For example, a TextField can combined with a dropdown which content is Row and Column

alt text

Getting started #

What you need is to provide [child], [controller] and [dropdownBuilder] for this container.

[child] will be built as a normal widget, while [dropdownBuilder] will be called when dropdown is open. [controller] is used to open or close the dropdown.

Usage #

There are some examples in the [/examples] directory of the repository.

final TextEditingController _textController;
final DropdownContainerController _dropdownController;

void buid(BuildContext context) {
    return DropdownContainer(
        controller: _dropdownController,
        dropdownBuilder: (context) => Row(children:[
            Expanded(child:Image.network('http://image-url')),
            Expanded(Column(children:_textController.text.map((e)=>ListTile(title:Text(e),onTap:(){})))),
        ]),
        child: TextField(controller: _textController, onChanged((e) {
            if ( e.isNotEmpty ) {
                _dropdownController.open();
            } else {
                _dropdownController.close();
            }
        })),
    );
}

Additional information #

2
likes
145
points
39
downloads

Documentation

API reference

Publisher

verified publishertu-x.com

Weekly Downloads

A container provides dropdown for its child widget. The child widget and the widget in dropdown is not limited.

License

MIT (license)

Dependencies

flutter

More

Packages that depend on dropdown_container