最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

flutter - How to reduce the safe area of the BottomNavigationBar? - Stack Overflow

programmeradmin0浏览0评论

As you can see in the picture below, I inserted a container for the advertising beneath the BottomNavigationBar which takes case of the safe area.

But now my BottomNavigationBar has extra room I want to remove.

Any idea?

The scaffold code I wrote is as follows:

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      bottomNavigationBar: BottomNavigationBar(
        onTap: (int index) => setState(() {
          _selectedIndex = index;
        }),
        currentIndex: selectedIndex,
        unselectedItemColor:
            Theme.of(context).colorScheme.inversePrimary, 
        type: BottomNavigationBarType.fixed,
        items: <BottomNavigationBarItem>[

          // === Station radar
          BottomNavigationBarItem(
            icon: kDebugMode ? const RadarTab() : const Icon(Icons.radar),
            label: i18n_Radar.i18n,
          ),

          // === User's savings
          BottomNavigationBarItem(
            icon: const Icon(Icons.savings),
            label: i18n_Savings.i18n,
          ),

          // === Price evolution
          BottomNavigationBarItem(
            icon: const Icon(AppIcons.chart_line),
            label: i18n_Evolution.i18n,
          ),

          // === Your vehicle
          BottomNavigationBarItem(
            icon: const Icon(AppIcons.car),
            label: i18n_Vehicle.i18n,
          ),
        ],
      ),
      body: tabViews[_selectedIndex],
    );
  }

发布评论

评论列表(0)

  1. 暂无评论