class BottomOfAppBar extends StatelessWidget implements PreferredSizeWidget {
BottomOfAppBar({Key? key, required this.tabs}) : super(key: key);
List tabs;
@override
Widget build(BuildContext context) {
return Obx(() => Container(
child: ColoredBox(
color: Colors.white,
child: Column(
children: [
widget.tabbarenable
? TabBar(
labelColor: Colors.purple[100],
indicatorColor: Colors.purple,
isScrollable: true,
labelPadding:
const EdgeInsets.symmetric(horizontal: 8.0),
tabs: <Widget>[tabs])
: Container()
],
),
),
));
}
@override
Size get preferredSize => const Size.fromHeight(55.0);
}
你好,
我试图使用选项卡变量在customAppBar类,但我得到这个错误。tab: tab行给出这个错误。
的任何帮助将List tabs;
替换为List<Widget> tabs;
,并提供如下选项卡tabs: tabs,
TabBar(
labelColor: Colors.purple[100],
indicatorColor: Colors.purple,
isScrollable: true,
labelPadding: const EdgeInsets.symmetric(horizontal: 8.0),
tabs: tabs,
);
它能解决你的问题吗?