EC
Size: a a a
EC
ND
s
ND
s
ND
ND
Column
, в котором TabBar
и TabBarView
. Как задать высоту для последнего?AS
EC
s
EC
child: DefaultTabController(
length: 2,
initialIndex: 1,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Align(
alignment: Alignment.centerLeft,
child: TabBar(
isScrollable: true,
labelColor: Constants.colorPrimary,
tabs: [
Tab(text: 'Auth',),
Tab(text: 'Basic',),
],
),
),
Flexible(
fit: FlexFit.loose,
child: TabBarView(
children: [
Text('Auth'),
Text('Basic'),
],
),
)
],
),
),
EC
The following assertion was thrown during performResize():
Horizontal viewport was given unbounded height.
Viewports expand in the cross axis to fill their container and constrain their children to match
their extent in the cross axis. In this case, a horizontal viewport was given an unlimited amount of
vertical space in which to expand.
The relevant error-causing widget was:
TabBarView
s
Column(
children: [
TabBar(
isScrollable: true,
labelColor: Constants.colorPrimary,
tabs: [
Tab(text: 'Auth',),
Tab(text: 'Basic',),
],
),
Expanded(
child: TabBarView(
children: [
Text('Auth'),
Text('Basic'),
],
),
)
],
),
EC
The following assertion was thrown during performLayout():
RenderFlex children have non-zero flex but incoming height constraints are unbounded.
When a column is in a parent that does not provide a finite height constraint, for example if it is
in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a
flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining
space in the vertical direction.
These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child
cannot simultaneously expand to fit its parent.
Consider setting mainAxisSize to MainAxisSize.min and using FlexFit.loose fits for the flexible
children (using Flexible rather than Expanded). This will allow the flexible children to size
themselves to less than the infinite remaining space they would otherwise be forced to take, and
then will cause the RenderFlex to shrink-wrap the children rather than expanding to fit the maximum
constraints provided by the parent.
EC
EC
ND
ND
s
DefaultTabController(
length: 2,
child: Column(
children: [
TabBar(
isScrollable: true,
labelColor: Colors.green,
tabs: [
Tab(
text: 'Auth',
),
Tab(
text: 'Basic',
),
],
),
Expanded(
child: TabBarView(
children: [
Text('Auth'),
Text('Basic'),
],
),
)
],
),
),
)
ND