setDropdownValues function Null safety
Implementation
void setDropdownValues(String name, List<dynamic> values, [int index = 0]) {
var elems = getElementsByName(name, index + 1);
List<String> vals = new List.from(values);
if (index < elems.length) {
elems[index].widget?.setState(() {
elems[index].widget?.values = vals;
elems[index].widget?.dropdownValue = elems[index].widget?.values[0];
});
}
}