I render some widgets using SingleChildScrollView
and Column
. Because the app can run on mutiple dimensions so I want to render the widgets sometimes in pairs like each 2 text fields beside each other and so on.
I tried to use GridView.count
like this:
Column(
children: [
GridView.count(
crossAxisCount: crossAxisCount, // using mediaquery to get the count
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
crossAxisSpacing: widget.width * 0.006,
mainAxisSpacing: widget.height * 0.01,
children: [
const TextField(),
const TextField(),
],
),
],
),
the text field itself is ok, but it takes much too much height, and if I pressed on the extra height it focuses on the input field. I tried wrapping it inside a sizedbox
, constraintedbox
but didn’t work. tried using listview
and singlechildscrollview
and it was the normal behavior where the text field only took the normal size. What is the problem here?