Created
May 18, 2020 14:17
-
-
Save theindianappguy/3a1c40b811cd8dcb02030929f729c4df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget wallpapersList({List<WallpaperModel> wallpapers, context}){ | |
return Container( | |
child: GridView.count( | |
shrinkWrap: true, | |
padding: EdgeInsets.symmetric(horizontal: 16), | |
physics: ClampingScrollPhysics(), | |
crossAxisCount: 2, | |
childAspectRatio: 0.6, | |
mainAxisSpacing: 6.0, | |
crossAxisSpacing: 6.0, | |
children: wallpapers.map((wallpaper){ | |
return GridTile( | |
child: GestureDetector( | |
onTap: (){ | |
Navigator.push(context, MaterialPageRoute( | |
builder: (context) => ImageView( | |
imgUrl: wallpaper.src.portrait, | |
) | |
)); | |
}, | |
child: Hero( | |
tag: wallpaper.src.portrait, | |
child: Container( | |
child: ClipRRect( | |
borderRadius: BorderRadius.circular(16), | |
child: Image.network(wallpaper.src.portrait, fit: BoxFit.cover,)), | |
), | |
), | |
), | |
); | |
}).toList(), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment