どうも、ちょげ(@chogetarou)です。
BottomNavigationBarの影の大きさを設定する方法を紹介します。
方法

BottomNavigationBarの影の大きさを設定するには、引数「elevation」を使います。
具体的な方法としては、引数「elevation」に影の大きさを指定します。
BottomNavigationBar(
elevation: /*影の大きさ*/,
items: [
//BottomNavigationBarItem
],
currentIndex: _currentIndex,
onTap: _onTap,
),
これで影の大きさを設定できます。
使用例
以下は、使用例です。
@override
Widget build(BuildContext context) {
return Scaffold(
body: _pages[_currentIndex],
bottomNavigationBar: BottomNavigationBar(
elevation: 50,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.settings),
label: 'Settings',
),
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.favorite),
label: 'Favorite',
),
],
currentIndex: _currentIndex,
onTap: _onTap,
),
);
}

まとめ
BottomNavigationbarの影の大きさを設定するには、引数「elevation」を使います。

[Flutter]IndexedStackを使ってBottomNavigationBarを実装するには?
IndexedStackを使って、BottomNavigationBarを実装する方法を紹介します。

[Flutter]BottomNavigationBarItemの使い方
BottomNavigationBarItemの使い方を解説します。

[Flutter]BottomNavigationBarの上にFloatingActionButtonを表示するには?
FloatingActionButtonは、デフォルトでは、BottomNavigationBarと重なってしまいます。これを回避して、BottomNavigationBarの上に、FloatingActionButtonを表示する方法を紹介します。
コメント