ios中的Flutter渐变底线(ios中的Home指示器)
我需要删除或更改该渐变底线的颜色并删除底部导航栏的边距。在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,
)