(一)效果图
(二)实现代码
实现要点:ListView和 ListTile
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ListViewPage extends StatelessWidget {
Widget ListPages() {
return ListView(
children: <Widget>[
ListTile(
leading:Image.asset("images/beauty1.png"),
title: Text("甜宠软妹是一个仙女本仙的存在人间尤物"),
subtitle: Text("棉花糖雪糕海盐冰淇淋樱桃小丸子",
style: TextStyle(
color: Colors.blue
),),
),
ListTile(
leading: Icon(Icons.settings),
title: Text("美少女樱樱子海贼王女帝仙女本仙"),
subtitle: Text("一二三四五上山打老虎仙女本仙当然是粉色啦",
style: TextStyle(fontSize: 13.0,
color: Colors.pink),),
trailing: Image.asset("images/beauty2.png"),
),
ListTile(
leading: Icon(Icons.settings,color: Colors.yellow),
title: Text("一个和尚挑水喝两个和尚抬水喝三个和尚没水喝四个和尚"),
subtitle: Text("山水间歌声回荡回荡思念的滚烫"),
),
ListTile(
leading: Icon(Icons.settings,color: Colors.blue,),
title: Text("师傅麻烦你把我送到解放碑"),
subtitle: Text("和他挥手拜拜有缘再会"),
),
],
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("甜宠软妹"),
centerTitle: true,
),
body: Container(
child: ListPages(),
),
);
}
}
**应用场景:**新闻列表