📅  最后修改于: 2022-03-11 15:00:06.788000             🧑  作者: Mango
TabBar get _tabBar => TabBar(
tabs: [
Tab(icon: Icon(Icons.call)),
Tab(icon: Icon(Icons.message)),
],
);
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 2,
child: Scaffold(
appBar: AppBar(
title: Text('AppBar'),
bottom: PreferredSize(
preferredSize: _tabBar.preferredSize,
child: ColoredBox(
color: Colors.red,
child: _tabBar,
),
),
),
),
);
}