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

outdated

A container provides dropdown for its child widget.

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 an Image

Getting started #

What you need is to provide [child], [controller] and [dropdownBuilder] for this container. [child] will be built as a normal widget, while the widget created [dropdownBuilder] will be created when dropdown is open. [controller] is used to open or close the dropdown.

Usage #

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:(){}s)))),
        ]),
        child: TextField(controller: _textController, onChanged((e) {
            if ( e.isNotEmpty ) {
                _dropdownController.open();
            } else {
                _dropdownController.close();
            }
        })),
    );
}

Additional information #

2
likes
0
points
39
downloads

Publisher

verified publishertu-x.com

Weekly Downloads

A container provides dropdown for its child widget.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on dropdown_container