BottomNavigationBar、BottomNavigationBarItem

526 阅读1分钟
BottomNavigationBar({
    Key key,
    @required this.items, // BottomNavigationBarItem类型的数组
    this.onTap, // 点击事件
    this.currentIndex = 0, // 当前选中index
    this.elevation = 8.0, // 阴影偏移
    BottomNavigationBarType type,
    Color fixedColor, // 不能和selectedItemColor同时指定 
    this.backgroundColor, // 背景色 
    this.iconSize = 24.0, // 图标大小
    Color selectedItemColor, // 选中时的颜色,不能和fixedColor同时指定
    this.unselectedItemColor, // 没有选中时的颜色
    this.selectedIconTheme = const IconThemeData(), // 选中时的图标的主题
    this.unselectedIconTheme = const IconThemeData(), // 没有选中时的图标的主题
    this.selectedFontSize = 14.0, // 选中时的字体的大小
    this.unselectedFontSize = 12.0, // 没有选中时的字体大小 
    this.selectedLabelStyle,
    this.unselectedLabelStyle,
    this.showSelectedLabels = true, // 是否展示被选中的item的文本
    bool showUnselectedLabels, // 是否展示没有被选中的文本
  })
BottomNavigationBarItem({
    @required Widget icon,//设置icon图标
    Widget title,//设置标签控件
    Widget activeIcon,//选中的时候的标签控件
    Color backgroundColor,//BottomNavigationBarType为shifting时的背景颜色
  })