Why when I use the TabBarView as child of Expanded to fill all the height of the screen as follows
Expanded(
child: TabBarView(
controller: _tabController,
children: [
Expanded(child: Text('1')),
Expanded(child: Text('1'))
],
),
)
it cause this error
RenderViewport does not support returning intrinsic dimensions.
When I remove the TabBarView, it still works.
I want the TabBarView to take all the height available with Expanded.
The Expanded is children of Column/SliverFillRemaining/CustomScrollView. hasScrollBody: true makes it works but when i click to TextFormField, it cause overflow because the page can’t be scroll
2
Answers
give some height to the TabBarView
Remove Expanded from children of tab bar view.
And for text field issue set hasScrollBody: false, fillOverscroll: true ,and wrap Column with SizedBox with height: MediaQuery.of(context).size.height,