Home > Software design >  The named parameter 'child' is required, but there's no corresponding argument
The named parameter 'child' is required, but there's no corresponding argument

Time:03-09

It shows a child error in TextButton. I don't know why show error. Please help me to solve this error and kindly tell me why show this error.

CodePudding user response:

You need to use child on TextButton.

TextButton(
  onPressed: () {},
  child: Text("TextButton"), //this
),

More about TextButton.

CodePudding user response:

In Text Button child and onPressed properties are mandatory for showing TextButton.

Add child and onPressed properties in your TextButton widget.

Example code:

TextButton(
  onPressed: () {},
  child: const Text('text'),
),
  • Related