颤振底部导航栏

时间:2020-07-31 09:51:04

标签: flutter flutter-layout

我已经用其svg图标项目构建了一个底部导航栏。目前,出于实验目的,我放置了相同颜色的图标。我有这个结果

enter image description here

我要实现的是未选择的图标必须变成灰色图标,因为当前我在导航栏中选择了主页图标。我也有这些灰色图标集

enter image description here

此外,从导航栏中以某种方式使选定的图标升高,如何解决?我对flutter非常陌生,对代码段的帮助将对您有所帮助。感谢您阅读本文。 :)

这是我的导航栏代码:

int _currentIndex = 0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      bottomNavigationBar: ClipRRect(
        borderRadius: BorderRadius.vertical(top: Radius.circular(15)),
        child: BottomNavigationBar(
            currentIndex: _currentIndex,
            onTap: (index) {
              setState(() {
                _currentIndex = index;
              });
            },
            items: [
              BottomNavigationBarItem(
                icon: SvgPicture.asset('assets/home-selected.svg'),
                title: Text(''),
              ),
              BottomNavigationBarItem(
                icon: SvgPicture.asset('assets/community-selected.svg'),
                title: Text(''),
              ),
              BottomNavigationBarItem(
                icon: SvgPicture.asset('assets/post-selected.svg'),
                title: Text(''),
              ),
              BottomNavigationBarItem(
                icon: SvgPicture.asset('assets/notification-selected.svg'),
                title: Text(''),
              ),
              BottomNavigationBarItem(
                icon: SvgPicture.asset('assets/settings-selected.svg'),
                title: Text(''),
              )
            ]),
      ),`

1 个答案:

答案 0 :(得分:1)

为防止图标移动,请设置1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token) at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.ListBlobsSegmentedAsync(String prefix, Boolean useFlatBlobListing, BlobListingDetails blobListingDetails, Nullable

type: BottomNavigationBarType.fixed
相关问题