Home > Software design >  Trying to put a TextFormField inside of a const
Trying to put a TextFormField inside of a const

Time:06-24

I'm trying to add a TextFormField() inside of a const to put some TextEditingController that I already have, but I have this error: Too many positional arguments: 0 expected, but 1 found. Try removing the extra positional arguments, or specifying the name for named arguments.

const NumberForm(
                  text: "Team number",
                  formText: "Enter team number",
                  padding: 0,
                  TextFormField(  //Here's the error
                    controller: nameteamController,
                  )
                ),

CodePudding user response:

You missed the key child

 NumberForm(
                  text: "Team number",
                  formText: "Enter team number",
                  padding: 0,
                  child:TextFormField(  //Here's the error
                    controller: nameteamController,
                  )
                ),
  • Related