どうも、ちょげ(@chogetarou)です。
CupertinoTabBarでタブで表示するアイコンのサイズを設定する方法を紹介します。
方法

CupertinoTabBarでタブのアイコンサイズを設定するには、引数「iconSize」を使います。
具体的には、CupertinoTabBarの引数「iconSize」にタブのアイコンサイズを指定します。
CupertinoTabBar(
iconSize: /*アイコンのサイズ*/,
・・・
),
引数「iconSize」を使うことで、CupertinoTabBarでタブのアイコンのサイズを設定することが出来ます。
使用例
以下は、使用例です。

class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return CupertinoTabScaffold(
tabBar: CupertinoTabBar(
iconSize: 15,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.circle),
label: 'Tab 1',
),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.add),
label: 'Tab 2',
),
],
),
tabBuilder: (BuildContext context, int index) {
return CupertinoTabView(
builder: (BuildContext context) {
return Center(
child: Text('Content of tab $index'),
);
},
);
},
);
}
}
コメント