Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.8k views
in Technique[技术] by (71.8m points)

flutter - BoxConstraints forces an infinite width

I am getting an error when I add a row in a column. I am getting the following error:

I/flutter ( 6449): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 6449): The following assertion was thrown during performLayout():
I/flutter ( 6449): BoxConstraints forces an infinite width.
I/flutter ( 6449): These invalid constraints were provided to RenderAnimatedOpacity's layout() function 

Also for reference here is my code:

return new Scaffold(
      backgroundColor: whiteColor,
      body: new Column(
        children: <Widget>[
          imgHeader,
          lblSignUp,
          txtEmail,
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              txtFirstName,
              txtLastName
            ],
          ),
        ],
      ),
    );
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you are using TextField Inside a Row then you need to use Flexible or Expanded.

More details are given here in this answer.

https://stackoverflow.com/a/45990477/4652688


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.7k users

...