bantandor
bantandor

Reputation: 267

1 positional argument(s) expected, but 0 found error

I get "1 positional argument(s) expected, but 0 found. (Documentation) Try adding the missing arguments" error. What am I missing?

SizedBox(height: 16.0),
                Text(
                  child: Text(_outputText),
                  style: TextStyle(
                    fontSize: 20.0,
                  ),
                ),

Upvotes: 0

Views: 95

Answers (1)

Md. Yeasin Sheikh
Md. Yeasin Sheikh

Reputation: 63839

Text widget doesnt have child params, it takes positional argument as string , the format will be

Text(
  _outputText,
  style: TextStyle(
    fontSize: 20.0,
  ),
),

More about Text

Upvotes: 1

Related Questions