myDropdownMenu method

Widget myDropdownMenu(
  1. String label,
  2. String selectedOption,
  3. List<String> options,
  4. void onSelected(
    1. String
    ),
)

Implementation

Widget myDropdownMenu(String label, String selectedOption, List<String> options, void Function(String) onSelected) {
return Semantics(
label: label,
child: DropdownMenu<String>(
initialSelection: selectedOption,
onSelected: (currentSelectedOption) {
selectedOption=currentSelectedOption.toString();
onSelected(currentSelectedOption.toString());
},
dropdownMenuEntries: options.map((option)=>DropdownMenuEntry<String>(value: option, label: option)).toList(),
enabled: true,
label: myTextView(label),
textAlign: TextAlign.center,
helperText: label,
hintText: label,
enableSearch: true,
enableFilter: true,
closeBehavior: DropdownMenuCloseBehavior.self,
),
);
}