From this answer I understand that I can check for null value before calling a function passed as optional parameter:
myFunction ({ Function onFocusChange }) {
if(onFocusChange != null) {
onFocusChange(boolValue)
}
}
I also understand that there's an optionality concept like Swift and Kotlin in Flutter, using "?" operator, though they all have their own quirks.
What I'm asking is if there's any way to call the optional function and silently fail if it's null, like in Swift:
onFocusChange?(boolValue);
I tried to add the question mark on Flutter, and it immediately tries to evaluate the "onFocusChange" as boolean (ternary operator).