小编Hun*_*yen的帖子

颤振:图像溢出容器

我通过对每个事件使用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)

mobile android widget dart flutter

5
推荐指数
1
解决办法
3409
查看次数

标签 统计

android ×1

dart ×1

flutter ×1

mobile ×1

widget ×1