這是底部導航欄的影像,

當我單擊圖示/按鈕時,徽標尺寸變大,如下圖所示

我的意思是當它點擊時圖示大小正在增加,如果我的問題不正確,我該如何禁用我很抱歉
下面的代碼
bottomNavigationBar: BottomNavigationBar(
currentIndex: selectedNavBar,
onTap : (newindex){
setState(() {
selectedNavBar = newindex;
});
},
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: const Icon(Icons.folder),
// ignore: deprecated_member_use
title: const Text(
'Home',
style: TextStyle(
fontFamily: 'futura',
),
),
backgroundColor: c,
),
BottomNavigationBarItem(
icon: const Icon(Icons.favorite),
// ignore: deprecated_member_use
title: const Text(
'Favourite',
style: TextStyle(
fontFamily: 'futura',
),
),
backgroundColor: c,
),
BottomNavigationBarItem(
icon: const Padding(
padding: EdgeInsets.all(29.0),
child: Image(
image: AssetImage(
'assets/nikelog.png',
),
),
),
// ignore: deprecated_member_use
title: const Text(
'Profile',
style: TextStyle(
fontFamily: 'futura',
),
),
backgroundColor: c,
),
BottomNavigationBarItem(
icon: const Icon(Icons.shopping_cart),
// ignore: deprecated_member_use
title: const Text(
'Profile',
style: TextStyle(
fontFamily: 'futura',
),
),
backgroundColor: c,
),
BottomNavigationBarItem(
icon: const Icon(Icons.account_balance_wallet_rounded),
// ignore: deprecated_member_use
title: const Text(
'Account',
style: TextStyle(
fontFamily: 'futura',
),
),
backgroundColor: c,
),
],
type: BottomNavigationBarType.shifting,
selectedItemColor: Colors.black,
selectedFontSize: 1,
unselectedItemColor: Colors.grey,
iconSize: 20,
elevation: 0,
),
這是底部導航欄的代碼
uj5u.com熱心網友回復:
selectedIconTheme和unselectedIconTheme是 BottomNavigationBar 的兩個屬性,可用于控制導航欄中圖示的大小(以及顏色和不透明度)。( https://api.flutter.dev/flutter/material/BottomNavigationBar-class.html )
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/410661.html
標籤:
上一篇:Flutterweb忽略調整大小
下一篇:自動切換文本欄位
