【发布时间】:2019-05-04 17:45:01
【问题描述】:
我是 Flutter 新手,我刚刚开发了我的第一个应用程序。所以,如果我的问题不清楚,请原谅我。
我现在正在处理底部导航栏。我用图标和文本制作了它,但只出现了第一个的图标和文本。其他唯一的图标。我怎样才能让所有出现?
这里是代码
bottomNavigationBar: BottomNavigationBar(
items: [
BottomNavigationBarItem(
icon: new Icon(Icons.home, color: Colors.black45),
title: new Text(
"الرئيسية",
style: TextStyle(color: Colors.black45),
)
),
BottomNavigationBarItem(
icon: new Icon(Icons.business, color: Colors.black45),
title: new Text(
"مرسال بيزنيس",
style: TextStyle(color: Colors.black45),
)),
BottomNavigationBarItem(
icon: new Icon(Icons.local_activity, color: Colors.black45),
title: new Text(
"أنشطة مرسال",
style: TextStyle(color: Colors.black45),
)),
BottomNavigationBarItem(
icon: new Icon(Icons.favorite_border, color: Colors.black45),
title: new Text(
"تبرع",
style: TextStyle(color: Colors.black45),
)),
BottomNavigationBarItem(
icon: new Icon(Icons.help, color: Colors.black45),
title: new Text(
"الأسئلة الشائعة",
style: TextStyle(color: Colors.black45),
))
],
onTap: (currentIndex){
_currentIndex = currentIndex;
if(_currentIndex==0)
Navigator.push(context,new MaterialPageRoute(builder: (context)=>new HomePage()));
else if(_currentIndex==1)
Navigator.push(context,new MaterialPageRoute(builder: (context)=>new business()));
else if(_currentIndex==2)
Navigator.push(context,new MaterialPageRoute(builder: (context)=>new activity()));
else if(_currentIndex==3)
Navigator.push(context,new MaterialPageRoute(builder: (context)=>new donate()));
else if(_currentIndex==4)
Navigator.push(context,new MaterialPageRoute(builder: (context)=>new faq()));
},
),
这就是结果:
另一个问题:如何使活动项目具有不同的颜色?
【问题讨论】:
标签: flutter