继续构建tabbar
This commit is contained in:
parent
60232041df
commit
d4b7e2446b
@ -6,4 +6,10 @@ class TabbarPageController extends GetxController {
|
|||||||
void onInit(){
|
void onInit(){
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void onItemTapped(int index) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -11,13 +11,21 @@ class TabbarPageView extends GetView {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final List<Widget> childPageList = getPages();
|
||||||
|
final List<BottomNavigationBarItem> listBarItems = getTabarItem();
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
title: const Text("Tab"),
|
items: listBarItems,
|
||||||
),
|
unselectedItemColor:Colors.grey,
|
||||||
body: const Center(
|
selectedItemColor: Colors.orange,
|
||||||
child: Text("我是tab页面"),
|
type: BottomNavigationBarType.fixed,
|
||||||
|
selectedFontSize: 14,
|
||||||
|
unselectedFontSize: 14,
|
||||||
|
currentIndex: 0,
|
||||||
|
|
||||||
),
|
),
|
||||||
|
body: childPageList[0],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,4 +50,6 @@ class TabbarPageView extends GetView {
|
|||||||
List<Widget> getPages(){
|
List<Widget> getPages(){
|
||||||
return [HomePageView(),CollectionPageView(),DownloadPageView(),MyPageView(),];
|
return [HomePageView(),CollectionPageView(),DownloadPageView(),MyPageView(),];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user