showTabbar() {
double? tabHeight;
return StatefulBuilder(builder: (context, setState) {
if (tabHeight == null) {
WidgetsBinding.instance.addPostFrameCallback((_) {
Future.delayed(Duration(milliseconds: 200)).then((_) {
setState(() {
tabHeight = tabKey.currentContext!.size!.height;
});
});
});
}
return DefaultTabController(
length: detailTabs.length,
child: Column(
children: [
TabBar(
...
),
TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
showDetailTab(),
],
),
],
)
);
});
}
showDetailTab() { return SingleChildScrollView( physics: NeverScrollableScrollPhysics(), child: ListView( key: tabKey, shrinkWrap: true, physics: NeverScrollableScrollPhysics(), children: [ ... ], ), ); }