繁体   English   中英

ios 中的 Flutter 渐变底线(ios 中的 Home 指示器)

[英]Flutter gradient bottom line in ios (Home indicator in ios)

我需要删除或更改该渐变底线的颜色并删除底部导航栏的边距。 android显示布局没有任何问题。 如何解决? 这是我的代码:

 Widget _buildContent(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        bool handle = !await widget._screenStates[_pressedPosition].currentState
            .maybePop();
        if (handle) {
          return await _showExitDialog(context);
        } else {
          return handle;
        }
      },
      child: SafeArea(
        child: Stack(
          fit: StackFit.expand,
          children: <Widget>[
            PageView(
              physics: new NeverScrollableScrollPhysics(),
              controller: _pageController,
              children: _mainScreens(),
            ),
            Align(
              alignment: Alignment.bottomCenter,
              child: CurvedNavigationBar(
                animationDuration: Duration(milliseconds: 200),
                backgroundColor: Colors.transparent,
                onTap: (int position) {
                  _bottomTapped(position);
                },
                height: BottomAppBarHeight,
                items: <Widget>[
                  ImageIcon(
                    AssetImage('assets/images/logo_small.png'),
                    color: PrimaryColor,
                    size: 40.0,
                  ),
                  Icon(
                    Icons.list,
                    size: 25.0,
                    color: (_pressedPosition == 1)
                        ? PrimaryColor
                        : DarkerGreyColor,
                  ),
                  Icon(
                    Icons.shopping_cart,
                    size: 25.0,
                    color: (_pressedPosition == 2)
                        ? PrimaryColor
                        : DarkerGreyColor,
                  ),
                  Icon(
                    Icons.favorite,
                    size: 25.0,
                    color: (_pressedPosition == 3)
                        ? PrimaryColor
                        : DarkerGreyColor,
                  ),
                  Icon(
                    Icons.account_circle,
                    size: 25.0,
                    color: (_pressedPosition == 4)
                        ? PrimaryColor
                        : DarkerGreyColor,
                  ),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }

感谢您的帮助,此外:这是带有底部渐变线的图像:

示例图片

我认为问题出在安全区域。

试试fit:StackFit.loose

或者

SafeArea(
      bottom: false,
      child: myWidgetThatFillsTheScreen,
  )

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM