File tree Expand file tree Collapse file tree 2 files changed +39
-29
lines changed Expand file tree Collapse file tree 2 files changed +39
-29
lines changed Original file line number Diff line number Diff line change @@ -34,20 +34,26 @@ class _Page1State extends State<Page1> {
3434
3535 @override
3636 Widget build (BuildContext context) {
37- return ListView .builder (
38- itemCount: list.length,
39- itemBuilder: (BuildContext context, int index) {
40- final data = list[index];
41- return ListTile (
42- contentPadding: EdgeInsets .all (10.0 ),
43- title: Text (data['title' ]),
44- subtitle: Text (
45- data['body' ],
46- maxLines: 2 ,
47- overflow: TextOverflow .ellipsis,
37+ return Column (
38+ children: < Widget > [
39+ Expanded (
40+ child: ListView .builder (
41+ itemCount: list.length,
42+ itemBuilder: (BuildContext context, int index) {
43+ final data = list[index];
44+ return ListTile (
45+ contentPadding: EdgeInsets .all (10.0 ),
46+ title: Text (data['title' ]),
47+ subtitle: Text (
48+ data['body' ],
49+ maxLines: 2 ,
50+ overflow: TextOverflow .ellipsis,
51+ ),
52+ );
53+ },
4854 ),
49- );
50- } ,
55+ ),
56+ ] ,
5157 );
5258 }
5359}
Original file line number Diff line number Diff line change @@ -36,22 +36,26 @@ class _Page2State extends State<Page2>
3636 @override
3737 Widget build (BuildContext context) {
3838 super .build (context);
39- return Container (
40- child: ListView .builder (
41- itemCount: list.length,
42- itemBuilder: (BuildContext context, int index) {
43- final data = list[index];
44- return ListTile (
45- contentPadding: EdgeInsets .all (10.0 ),
46- title: Text (data['title' ]),
47- trailing: Image .network (
48- data['thumbnailUrl' ],
49- height: 20.0 ,
50- width: 20.0 ,
51- ),
52- );
53- },
54- ),
39+ return Column (
40+ children: < Widget > [
41+ Expanded (
42+ child: ListView .builder (
43+ itemCount: list.length,
44+ itemBuilder: (BuildContext context, int index) {
45+ final data = list[index];
46+ return ListTile (
47+ contentPadding: EdgeInsets .all (10.0 ),
48+ title: Text (data['title' ]),
49+ trailing: Image .network (
50+ data['thumbnailUrl' ],
51+ height: 20.0 ,
52+ width: 20.0 ,
53+ ),
54+ );
55+ },
56+ ),
57+ ),
58+ ],
5559 );
5660 }
5761
You can’t perform that action at this time.
0 commit comments