【发布时间】:2021-11-11 16:14:31
【问题描述】:
我希望将 SVG 的图像切成两半。 SVG 是圆圈底部的较轻的波。它目前太高了,我需要将尺寸减小一半左右。我将 SVG 放在它自己的容器中,但是修改容器的大小并不能完全按照我期望的方式修改图像的大小。任何建议表示赞赏。
return Container(
decoration: bubbleBoxDecoration,
height: bubbleDiameter.toDouble(),
width: bubbleDiameter.toDouble(),
child: Stack(
children: [
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
'Upper Body',
style: labelTextStyle,
),
Text(
'45',
style: weightTextStyle,
),
Text(
'lbs',
style: unitTextStyle,
),
],
),
),
Container(
height: bubbleDiameter.toDouble(),
width: bubbleDiameter.toDouble(),
child: SvgPicture.asset(
assetName,
alignment: Alignment.bottomCenter,
),
),
],
),
);
}
}
【问题讨论】:
-
你试过了吗:
SvgPicture.asset( assetName, alignment: Alignment.bottomCenter, width: 100, height: 100 ),
标签: flutter dart flutter-layout