I am getting an error when I add a row in column. I am getting following error:
I/flutter ( 6449): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═══════════════
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.
Use Expanded
Row(
children: [
Expanded(child: TextField()),
// more widgets
],
)
Use Flexible
Row(
children: [
Flexible(child: TextField()),
// more widgets
],
)
Wrap it in Container or SizedBox and provide width
Row(
children: [
SizedBox(width: 100, child: TextField()),
// more widgets
],
)