The following error message occurred.
"The argument type ‘String?’ can’t be assigned to the parameter type ‘String’"
I don’t understand why this is an error.
If there is anyone who knows the solution, please let me know.
i want to make model and solve that…
thank you…
2
Answers
The value
imageFilePath
could be null so that means:or
You could make the field imageFile in your Face class null-aware:
then you can easily do this:
final face = Face(name:faceName,imagePath:imageFilePath);
There is another option if you don’t want to do the above two suggestions:
imageFilePath
is a nullabe String, you can do null check and proceed the way did forfaceImagePath
.