【问题标题】:Remove overlay on press on BottomNavigationBarItem在按下 BottomNavigationBarItem 时移除覆盖
【发布时间】:2023-01-25 16:09:32
【问题描述】:

enter image description here

BottomNavigationBar( elevation: 10, type: BottomNavigationBarType.fixed, backgroundColor: Color(0xFFFBFBFB), showSelectedLabels: false, showUnselectedLabels: false, items: <BottomNavigationBarItem>[ BottomNavigationBarItem( icon: Column( children: [ SvgPicture.asset( 'assets/icons/workShopIcon.svg', ), Text( AppLocalizations.of(context)!.yourNft, style: Styles.grey13Medium, ) ], ), activeIcon: Column( children: [ SvgPicture.asset( 'assets/icons/YourNftSelected.svg', ), Text( AppLocalizations.of(context)!.yourNft, style: Styles.blue13Medium, ) ], ), label: 'Your NFTs', ), BottomNavigationBarItem( icon: Column( children: [ SvgPicture.asset( 'assets/icons/AnalyticsUnselected.svg', ), Text( AppLocalizations.of(context)!.analytics, style: Styles.grey13Medium, ) ], ), activeIcon: Column( children: [ SvgPicture.asset( 'assets/icons/AnalyticsSelected.svg', ), Text( AppLocalizations.of(context)!.analytics, style: Styles.blue13Medium, ) ], ), label: 'Analytics', ), BottomNavigationBarItem( icon: Column( children: [ SvgPicture.asset( 'assets/icons/RedeemUnselected.svg', ), Text( AppLocalizations.of(context)!.redeem, style: Styles.grey13Medium, ) ], ), activeIcon: Column( children: [ SvgPicture.asset( 'assets/icons/RedeemSelected.svg', color: Color(0xFF0273EB), ), Text( AppLocalizations.of(context)!.redeem, style: Styles.blue13Medium, ) ], ), label: 'Redeem', ), ], currentIndex: _currentTab, onTap: _onItemTapped, )

我们尝试更改覆盖,但我没有在 BottomNavigationBar 和 BottomNavigationBarItem 中找到覆盖属性

【问题讨论】:

  • 请提供足够的代码,以便其他人可以更好地理解或重现问题。

标签: flutter flutter-dependencies flutter-animation flutter-test


【解决方案1】:

让你的代码更具可读性

如果你想删除底部导航栏上的飞溅,你可以将它的颜色设置为透明,

Theme(
  data: Theme.of(context).copyWith(
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
  ),
  child: ChildWidget(),
);

【讨论】:

    猜你喜欢
    • 2021-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多