find_dropdown 0.1.0 copy "find_dropdown: ^0.1.0" to clipboard
find_dropdown: ^0.1.0 copied to clipboard

outdated

Simple and robust FindDropdown with item search feature, making it possible to use an offline item list or filtering URL for easy customization.

FindDropdown package - [ver em português] #

Simple and robust FindDropdown with item search feature, making it possible to use an offline item list or filtering URL for easy customization.

packages.yaml #

find_dropdown: <lastest version>

Import #

import 'package:find_dropdown/find_dropdown.dart';

Simple implementation #

FindDropdown(
  items: ["Brasil", "Itália", "Estados Unidos", "Canadá"],
  label: "País",
  onChanged: (String item) => print(item),
  selectedItem: "Brasil",
);

Endpoint implementation (using Dio package) #

FindDropdown<UserModel>(
  label: "Nome",
  onFind: (String filter) async {
    var response = await Dio().get(
        "http://5d85ccfb1e61af001471bf60.mockapi.io/user",
        queryParameters: {"filter": filter},
    );
    var models = UserModel.fromJsonList(response.data);
    return models;
  },
  onChanged: (UserModel data) {
    print(data);
  },
);

Customization #

You can customize the layout of the FindDropdown and its items. EXAMPLE

To customize the FindDropdown, we have the dropdownBuilder property, which takes a function with the parameters:

  • BuildContext context: current context;
  • T item: Current item, where T is the type passed in the FindDropdown constructor.

To customize the items, we have the dropdownItemBuilder property, which takes a function with the parameters:

  • BuildContext context: current context;
  • T item: Current item, where T is the type passed in the FindDropdown constructor.
  • bool isSelected: Boolean that tells you if the current item is selected.

View more Examples #

83
likes
0
pub points
89%
popularity

Publisher

unverified uploader

Simple and robust FindDropdown with item search feature, making it possible to use an offline item list or filtering URL for easy customization.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, rxdart, select_dialog

More

Packages that depend on find_dropdown