我有一个如下所示的UI(img1),当我滚动UI时,渐变卡会稍微重叠它的父容器,但如果我删除了渐变,一切都很好。有没有办法在不去除我卡片中的渐变背景的情况下防止这种重叠?
Img1:
Img2:
以下是我的示例代码:
Container(
margin: smallWidgetPadding,
width: MediaQuery.of(context).size.width,
decoration: ShapeDecoration(
color: colorScheme.onPrimary,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30))),
shadows: [BoxShadow(color: colorScheme.shadow, blurRadius: 5)]),
child: Card(
margin: margin,
child: Container(
decoration: ShapeDecoration(
gradient: gradient, shape: roundedRectangleBorderless),
child: child)))