flutter
Dynamic height is not getting adjusted for all the tabs and when height is not present in the container the box is disappearing what is the solution or any other method to solve so that all the list of words in the wrap gets dynamically adjusted to the height
Attaching code below for reference:
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
margin: const EdgeInsets.only(left: 20),
// height: 49,
child: TabBar(
isScrollable: true,
controller: _macroTabController,
physics: const NeverScrollableScrollPhysics(),
indicatorColor: ColorsConfig.textBlack,
labelColor: ColorsConfig.checkMarkBlue,
unselectedLabelColor: ColorsConfig.textBlack,
labelStyle: TextStyleConfig.getSubtitle2Style(
color: ColorsConfig.checkMarkBlue),
labelPadding: const EdgeInsets.only(left: 0, right: 20, top: 4),
indicatorPadding: const EdgeInsets.only(top: 0, bottom: 8),
indicator: const RoundUnderlineTabIndicator(
borderSide: BorderSide(
width: 3,
color: ColorsConfig.checkMarkBlue,
)),
// ignore: prefer_const_literals_to_create_immutables
tabs: <Widget>[
const Tab(
text: 'All',
),
const Tab(
text: 'Appointment',
),
const Tab(
text: 'Guest',
),
const Tab(
text: 'Location',
),
const Tab(
text: 'Others',
),
],
),
),
Container(
height: (widget.macroListData.length / 4) * 50,
//height: 500,
margin:
const EdgeInsets.only(left: 20, right: 12, bottom: 12, top: 18),
//constraints: const BoxConstraints.expand(),
constraints: const BoxConstraints(minHeight: 500),
child: TabBarView(
controller: _macroTabController,
physics: const NeverScrollableScrollPhysics(),
children: [
Wrap(
spacing: 16,
runSpacing: 16,
children: widget.macroListData.isNotEmpty
? widget.macroListData
.map((x) =>
getPadedMacroText(x, widget.buildLocation, context))
.toList()
: [],
),
Wrap(
spacing: 16,
runSpacing: 16,
children: widget.macroListData.isNotEmpty
? widget.macroListData
.where((element) => element.category == 'Appointment')
.map((x) =>
getPadedMacroText(x, widget.buildLocation, context))
.toList()
: [],
),
Wrap(
spacing: 16,
runSpacing: 16,
children: widget.macroListData.isNotEmpty
? widget.macroListData
.where((element) => element.category == 'Guest')
.map((x) =>
getPadedMacroText(x, widget.buildLocation, context))
.toList()
: [],
),
Wrap(
spacing: 16,
runSpacing: 16,
children: widget.macroListData.isNotEmpty
? widget.macroListData
.where((element) => element.category == 'Location')
.map((x) =>
getPadedMacroText(x, widget.buildLocation, context))
.toList()
: [],
),
Wrap(
spacing: 16,
runSpacing: 16,
children: widget.macroListData.isNotEmpty
? widget.macroListData
.where((element) => element.category == 'Others')
.map((x) =>
getPadedMacroText(x, widget.buildLocation, context))
.toList()
: [],
),
],
),
)
],
);
}
the above code