From c001a836dbed350f3b210bbe8397eea760590c6b Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Wed, 12 Feb 2020 13:40:33 +0000 Subject: [PATCH] Finished Section 11 --- lib/src/widgets/image_list.dart | 40 ++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/image_list.dart b/lib/src/widgets/image_list.dart index d29c110..aefcfe3 100644 --- a/lib/src/widgets/image_list.dart +++ b/lib/src/widgets/image_list.dart @@ -5,4 +5,42 @@ class ImageList extends StatelessWidget { final List images; ImageList(this.images); -} \ No newline at end of file + + + Widget build(context) { + return ListView.builder( + itemCount: images.length, + itemBuilder: (context, int index) { + return buildImage(images[index]); + }, + ); + } + + Widget buildImage(ImageModel image) { + return Container( + decoration: BoxDecoration( + border: Border.all(color:Colors.black87), + ), + margin:EdgeInsets.all(20.0), + padding:EdgeInsets.all(20.0), + child:Column( + children: [ + Padding( + child:Image.network(image.url), + padding:EdgeInsets.only( + bottom:15.0, + ) + ), + Text(image.title), + ] + ), + + ); + } +} + + + +// Image.network(images[index].url); + +// Image.network(image.url) \ No newline at end of file