您好,我有一个底部导航栏,如下所示:请单击此处
我想要做的是改变文本的位置。我的意思是我的图标和我的标签应该看起来并排。(单击此处查看我想做的事情 看起来很简单,但我找不到任何事情要做。谢谢
这是我的代码:
PageController _pageController = PageController(
initialPage: 0, ); int currentIndex = 0;
Widget childWidget = ChildWidget(
number: AvailableNumber.First,
); @override
void dispose() {
_pageController.dispose();
super.dispose(); }
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: arkaPlan,
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.shifting,
selectedItemColor: bottomNavi,
unselectedItemColor: arkaPlan,
currentIndex: currentIndex,
onTap: (value) {
currentIndex = value;
_pageController.animateToPage(
value,
duration: Duration(milliseconds: 100),
curve: Curves.linear,
);
setState(() {});
},
items: [
BottomNavigationBarItem(
icon: Icon(LineIcons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.trending_up),
label: ("Second"),
),
BottomNavigationBarItem(
icon: Icon(Icons.dashboard),
label: ("Third"),
),
BottomNavigationBarItem(
icon: Icon(Icons.dashboard),
label: ("Third"),
),
],
),
body: PageView(
controller: _pageController,
onPageChanged: (page) {
setState(() {
currentIndex = page;
});
},
children: <Widget>[
ChildWidget(number: AvailableNumber.First),
ChildWidget(number: AvailableNumber.Second),
ChildWidget(number: AvailableNumber.Third),
ChildWidget(number: AvailableNumber.Third)
],
),
);
} }