本文最后更新于 798 天前
使用
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('title'.tr),
bottom: HjtTabBar(
tabs: const [Tab(text: "音乐"), Tab(text: "动态"), Tab(text: "语文")],
// labelPadding: EdgeInsets.symmetric(horizontal: 8),
controller: _controller,
indicatorSize: TabBarIndicatorSize.label,
// isScrollable: true,
padding: EdgeInsets.zero,
indicator: RRecTabIndicator(
radius: 12
),
indicatorMinWidth: 6,
// indicator: const BoxDecoration()
),
),
body: Container(
child: TabBarView(
controller: _controller,
children: const [
Center(
child: Text("音乐"),
),
Center(
child: Text("动态"),
),
Center(
child: Text("语文"),
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
},
),
);
源码