jus*_*sty 20 height dart flutter flutter-card
Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
child: Image.network( 'https://placeimg.com/640/480/any',fit: BoxFit.fill),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
elevation: 5,
margin: EdgeInsets.all(10),
)
Run Code Online (Sandbox Code Playgroud)
Joã*_*res 54
要修改卡片的宽度或高度,您可以将其包装在容器小部件中并为其提供高度和/或宽度属性。
请在下面查看您的代码,其中包含一个高度为 500 的容器:
Container(
height: 500,
child: Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
child: Image.network(
'https://placeimg.com/640/480/any', fit: BoxFit.fill,),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
elevation: 5,
margin: EdgeInsets.all(10),
),
),
Run Code Online (Sandbox Code Playgroud)
小智 5
时间在移动,更喜欢你:https : //api.flutter.dev/flutter/widgets/SizedBox-class.html
SizedBox(
height: double.infinity,
child: Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
child: Image.network(
'https://placeimg.com/640/480/any',
fit: BoxFit.fill,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
elevation: 5,
margin: EdgeInsets.all(10),
),
),
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
48837 次 |
| 最近记录: |