fromListOfStrings static method

List<DropdownValue> fromListOfStrings(
  1. List<String> values
)

A simple static helper to help with when you don't need the descriptions.

Without using this helper

   ModularCustomizableDropdown.displayOnCallback(
          onValueSelect: widget.onValueSelect,
          allDropdownValues: widget.dropdownValues
              .map((e) => DropdownValue(
                    value: e,
                  ))
              .toList(),
    ...

With this helper

   ModularCustomizableDropdown.displayOnCallback(
          onValueSelect: widget.onValueSelect,
          allDropdownValues: DropdownValue
              .fromListOfStrings(widget.dropdownValues)
    ...

Implementation

static List<DropdownValue> fromListOfStrings(List<String> values) {
  return values.map((e) => DropdownValue(value: e)).toList();
}