Does the Dart language have anything better to handle the potential of the callback being null than I have done here:
if(widget.onChanged!=null){
widget.onChanged!(value);
}
In case onChanged is of type Function, you can use
onChanged?.call(value);
This will only call the function if it is not undefined/null.