继续构建tabbar

This commit is contained in:
bluesea 2024-05-11 11:24:56 +08:00
parent 60232041df
commit d4b7e2446b
2 changed files with 21 additions and 5 deletions

View File

@ -6,4 +6,10 @@ class TabbarPageController extends GetxController {
void onInit(){
super.onInit();
}
void onItemTapped(int index) {
}
}

View File

@ -11,13 +11,21 @@ class TabbarPageView extends GetView {
@override
Widget build(BuildContext context) {
final List<Widget> childPageList = getPages();
final List<BottomNavigationBarItem> listBarItems = getTabarItem();
return Scaffold(
appBar: AppBar(
title: const Text("Tab"),
),
body: const Center(
child: Text("我是tab页面"),
bottomNavigationBar: BottomNavigationBar(
items: listBarItems,
unselectedItemColor:Colors.grey,
selectedItemColor: Colors.orange,
type: BottomNavigationBarType.fixed,
selectedFontSize: 14,
unselectedFontSize: 14,
currentIndex: 0,
),
body: childPageList[0],
);
}
@ -42,4 +50,6 @@ class TabbarPageView extends GetView {
List<Widget> getPages(){
return [HomePageView(),CollectionPageView(),DownloadPageView(),MyPageView(),];
}
}