1+ import 'package:flutter/material.dart' ;
2+ import 'package:flutter_screenutil/flutter_screenutil.dart' ;
3+
4+ class Index extends StatefulWidget {
5+ @override
6+ _IndexState createState () => _IndexState ();
7+ }
8+
9+ class _IndexState extends State <Index > {
10+ List listview = [
11+ 'http://pic1.win4000.com/wallpaper/2019-02-15/5c664c3e1d90c.jpg' ,
12+ 'http://pic1.win4000.com/wallpaper/2019-02-15/5c664c40f3bc2.jpg' ,
13+ 'http://pic1.win4000.com/wallpaper/2019-02-15/5c664c4406144.jpg' ,
14+ 'http://pic1.win4000.com/wallpaper/2019-02-15/5c664c46823f8.jpg' ,
15+ 'http://pic1.win4000.com/wallpaper/2019-02-15/5c664c48c73d0.jpg' ,
16+ 'http://pic1.win4000.com/wallpaper/2019-02-15/5c664c4b4dc2f.jpg' ,
17+ 'http://pic1.win4000.com/wallpaper/2019-02-15/5c664c51a2a45.jpg' ,
18+ 'http://pic1.win4000.com/wallpaper/2019-02-14/5c65107a0ee05.jpg' ,
19+ 'http://pic1.win4000.com/wallpaper/2019-02-14/5c65108043791.jpg' ,
20+ 'http://pic1.win4000.com/wallpaper/2019-02-14/5c651084373de.jpg'
21+ ];
22+ @override
23+ Widget build (BuildContext context) {
24+ return Scaffold (
25+ appBar: AppBar (title: Text ('ListView.Builder' ),),
26+ body: ListView .builder (
27+ itemCount: listview.length,
28+ itemBuilder: (BuildContext context, int index) {
29+ return ListTile (
30+ title: Text ('title $index ' ),
31+ subtitle: Text ('subtitle $index ' ),
32+ leading: CircleAvatar (
33+ backgroundImage: NetworkImage (listview[index]),
34+ ),
35+ trailing: Icon (Icons .arrow_right),
36+ );
37+ },
38+ )
39+ );
40+ }
41+ }
0 commit comments