defaultTabBar function

Widget defaultTabBar({
  1. required List<TabBarViewModel> tabs,
  2. required Widget tabBar,
  3. double? width,
  4. double? height = 500,
  5. int initialIndex = 0,
})

Implementation

Widget defaultTabBar({
  required final List<TabBarViewModel> tabs,
  required final Widget tabBar,
  final double? width,
  final double? height = 500,
  final int initialIndex = 0,
}) =>
    DefaultTabController(
      initialIndex: initialIndex,
      length: tabs.length,
      child: Column(
        children: <Widget>[
          tabBar,
          SizedBox(
            width: width ?? screenWidth,
            height: height,
            child: TabBarView(
              physics: const NeverScrollableScrollPhysics(),
              children: tabs.map((final TabBarViewModel view) => view.view).toList(),
            ),
          )
        ],
      ),
    );