Open 10terabyte opened 1 year ago
It seems like there might be a type mismatch in the argument you're passing to the itmClick callback function. The error message is indicating that the expected type for the argument is void Function(Prediction)?, which means it can accept either a function or null. However, it appears that you're passing a non-nullable void Function(Prediction).
To fix this issue, you can make the itmClick callback function nullable by adding a question mark (?) after the function type. This modification will allow the argument to accept both functions and null values.
This change should resolve the type mismatch problem and ensure that the itmClick callback function behaves as intended.
itmClick: (Prediction? prediction) {
if (prediction != null) {
controller.text = prediction.description;
controller.selection = TextSelection.fromPosition(TextPosition(offset: prediction.description.length));
}
}
I get error from this code. Just used this code from sample. Please let me know what is the issue.