79135903

Date: 2024-10-29 05:21:57
Score: 0.5
Natty:
Report link

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: [ ... ], ), ); }

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Ju hyun Kim