继续构建tabbar
This commit is contained in:
parent
60232041df
commit
d4b7e2446b
@ -6,4 +6,10 @@ class TabbarPageController extends GetxController {
|
||||
void onInit(){
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
|
||||
void onItemTapped(int index) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -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(),];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user