Я делаю список информации о событии во Флаттере, используя Карту для каждого события.Начало каждой карты связано с событием.
Я хочу сделать мою Карту прямоугольником с закругленными углами, но когда я помещаю изображение в дочерние элементы строки внутри дочернего элемента карты, уголизображение не округлено.
Класс моей карты:
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: Image.network(widget.imageURL,
fit: BoxFit.fitHeight,
),
),
SizedBox(
width: 10.0,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(widget.title,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),maxLines: 2, overflow: TextOverflow.clip,
),
SizedBox(height: 5.0,),
Text(widget.time.toString(),
overflow: TextOverflow.clip,
),
SizedBox(height: 5.0,),
Text(widget.place,
overflow: TextOverflow.clip,
),
],
),
),
SizedBox(
width: 50.0,
child: Align(
alignment: Alignment.centerRight,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: IconButton(
onPressed: () {},
icon: Icon(Icons.favorite_border)),
)),
),
],
),
),
),
);
}
}
![Preview Preview](https://i.stack.imgur.com/J9Twd.png)