Search code examples
fluttersyntax-error

error in Flutter The named parameter 'onChanged' is required, but there's no corresponding argument. Try adding the required argument


What is the problem? How can I solve it? My codes:

enter image description here


Solution

  • You should pass the onChanged argument in ApprovalQueuePage as it is required.Pass it like this:

    //When calling approval queue leave everything as it is
    //just replace ApprovalQueuePage() with
    ApprovalQueuePage(onChanged: (String value){
        //You can do anything with the value
    })