londonappbrewery / Flutter-Course-Resources

Learn to Code While Building Apps - The Complete Flutter Development Bootcamp
https://www.appbrewery.co
10.29k stars 3.07k forks source link

why I see this error regarding S9 L8 (Function Challenge)? #70

Open JaSho145 opened 2 years ago

JaSho145 commented 2 years ago

image

prateek-aher commented 2 years ago

That's what you got to figure out. That's the challenge. Close this issue please.

JohnMeyerhoff commented 2 years ago

I assume you missed the curly braces around your parameters which should not be there. it should be

add(int n1, int n2)

instead of

add({int n1, int n2})

Your optional Parameters are required in your method, this article might be helpful: https://zaiste.net/posts/dart-optional-function-parameters/ The message you are getting does not get straight to the point because it does not see the issue in L16 of using them but rather in L15 because the optional parameters do not have a provided default value. Please also refrain from sending large screenshots, as it will be sent to all 500+ people watching this repository by default.