我通过对每个事件使用Card在Flutter中列出事件信息。每张卡的前导与事件有关。
我想将Card做成圆角矩形,但是当我将图像放在Card的child内Row的子元素内时,图像的角不是圆的。
我的卡类:
import 'package:flutter/material.dart';
class SmallEventCard extends StatefulWidget {
final imageURL;
final title;
final time;
final place;
SmallEventCard({this.imageURL, this.title, this.time, this.place});
@override
_SmallEventCardState createState() => _SmallEventCardState();
}
class _SmallEventCardState extends State<SmallEventCard> {
bool isFavorite;
@override
void initState() {
// TODO: implement initState
super.initState();
isFavorite = false;
}
@override
Widget build(BuildContext context) {
final screen = MediaQuery.of(context).size;
return Material(
child: SizedBox(
height: screen.height / 7,
child: Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
child: Row(
children: <Widget>[
AspectRatio(
aspectRatio: 4 / 3,
child: …Run Code Online (Sandbox Code Playgroud)