颤振列表视图填充

flutter listview padding

我一直在尝试实现如下图所示的列表视图

我现在正在使用 Card,这就是它的样子。

代码如下:

 child: Card(
              child: Row(
                children: <Widget>[

                  Container(
                  margin: const EdgeInsets.only(left: 40,top: 10,right: 1,bottom: 10)                
                      
                    width: 80,
                    height: 80,
                child: CircleAvatar(
                  backgroundImage:
                  NetworkImage("https://picsum.photos/500/300"),
                  maxRadius: 15,
                  minRadius: 15,
                )

                  ),
                  Padding(
                    padding: const EdgeInsets.all(10.0),
                    //padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 35.0),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        Text(

                          titleList[index],
                          textAlign: TextAlign.center,
                          style: TextStyle(

                            fontSize: 19,
                            color: Colors.blueAccent,
                            fontWeight: FontWeight.bold,
                          ),
                        ),
                        SizedBox(
                          height: 10,
                        ),

                      ],
                    ),
                  )
                ],
              ),
            ),

我真的需要一些帮助,让它看起来与第一张图片上的行相似

希望这对您有所帮助..

小部件:

class CircularCard extends StatelessWidget {
  final VoidCallback? onPressed;
  final String? title;
  final String? image;
  const CircularCard({Key? key, this.onPressed, this.image,           this.title})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    final cardImage = Container(
      alignment: FractionalOffset.centerLeft,
      child: CircleAvatar(
        radius: 50.0,
        backgroundImage: NetworkImage(image ?? ''),
        backgroundColor: Colors.red,
      ),
    );

    final cardContent = Container(
      margin: const EdgeInsets.fromLTRB(60, 22, 10, 10),
      constraints: const BoxConstraints.expand(),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Container(height: 4.0),
          Text(
            title ?? '',
            style: const TextStyle(
              fontSize: 19,
              color: Colors.red,
              fontWeight: FontWeight.bold,
            ),
          ),
          Container(height: 10.0),
        ],
      ),
    );

    final cardDesign = Container(
      child: cardContent,
      height: 80.0,
      margin: const EdgeInsets.only(left: 46.0, top: 12.0),
      decoration: BoxDecoration(
        color: Colors.white,
        shape: BoxShape.rectangle,
        border: Border.all(
          color: Colors.red,
          width: 3,
        ),
        borderRadius: BorderRadius.circular(8.0),
        boxShadow: const <BoxShadow>[
          BoxShadow(
            color: Colors.black12,
            blurRadius: 10.0,
            offset: Offset(0.0, 10.0),
          ),
        ],
      ),
    );

    return GestureDetector(
      onTap: () => onPressed,
      child: Container(
        margin: const EdgeInsets.symmetric(
          vertical: 2.0,
          horizontal: 8.0,
        ),
        child: Stack(
          children: <Widget>[
            cardDesign,
            cardImage,
          ],
        ),
      ),
    );
  }
}

使用小部件:

child: Container(
          margin: const EdgeInsets.symmetric(
            vertical: 14.0,
            horizontal: 10.0,
          ),
          child: CircularCard(
            title: 'Business',
           image:'https://picsum.photos/500/300',
          ),

小部件的外观如下: https://i.stack.imgur.com/wCJ22.png