标签:mic mamicode code avatar home view lead png url
import ‘package:flutter/material.dart‘; import ‘res/listData.dart‘; void main() { runApp(MaterialApp( title: "demo", home: MyApp(), )); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text("FlutterDemo"),), body: ListView( children: listData.map((value) { return Card( margin: EdgeInsets.all(10), child: Column( children: <Widget>[ AspectRatio( aspectRatio: 20/9, child: Image.network(value["imageUrl"],fit: BoxFit.cover,), ), ListTile( leading: CircleAvatar( backgroundImage: NetworkImage(value["imageUrl"]), ), title: Text(value["title"]), subtitle: Text(value["description"],maxLines: 1,overflow: TextOverflow.ellipsis), ) ], ), ); }).toList() ) ); } }
Flutter——CircleAvatar组件(圆形头像组件)
标签:mic mamicode code avatar home view lead png url
原文地址:https://www.cnblogs.com/chichung/p/11994396.html