0

So, i'm trying to create an app in flutter and cannot work my way around the syntax code. The error is that it is not able to recognise onPressed. Ps new to flutter.

enter image description here

1 Answer 1

0

The problem is you're trying to call onPressed on a Center widget which has no onPressed parameter.

Try calling onPressed on a RaisedButton or any other widget that has an onPressed parameter instead:

RaisedButton(
onPressed: //Your function here,
),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.