BoxConstraints forces an infinite width

Reason for the error:

TextField expands in horizontal direction and so does the Row, so we need to constrain the width of the TextField, there are many ways of doing it.

  1. Use Expanded

     Row(
      children: <Widget>[
        Expanded(child: TextField()),
        // more widgets
      ],
    )
    
  2. Use Flexible

    Row(
      children: <Widget>[
        Flexible(child: TextField()),
        // more widgets
      ],
    )
    
  3. Wrap it in Container or SizedBox and provide width

    Row(
      children: <Widget>[
        SizedBox(width: 100, child: TextField()),
        // more widgets
      ],
    )       
    

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