Add TabBarView
Từ appbar : quản lý - search ( phía trên )
- bottom : TabBar.
body :
body: const TabBarView(children: [
Center(child: Text('men screen'),),
Center(child: Text('women screen'),),
Center(child: Text('shoes screen'),),
]),
Tổng đoạn code :
class _homescreenState extends State<homescreen> {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length:3 ,
child: Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.white,
title: const CupertinoSearchTextField(),
bottom: TabBar(
tabs: [
Tab(child: Text('men ',style:TextStyle(color: Colors.grey.shade600) ,),),
Tab(child: Text('women ',style:TextStyle(color: Colors.grey.shade600) ,),),
Tab(child: Text('shoes ',style:TextStyle(color: Colors.grey.shade600) ,),),
],
),
),
body: const TabBarView(children: [
Center(child: Text('men screen'),),
Center(child: Text('women screen'),),
Center(child: Text('shoes screen'),),
]),
),
);
}
}
Git : https://github.com/ANH2018/Bottom-Navigation-Bar/tree/Bottom_bar_new_window