Skip to content

Instantly share code, notes, and snippets.

@ijoschek ijoschek/.\lib\main.dart Secret

Last active Aug 22, 2019
Embed
What would you like to do?
flutter_gridview_tut
import 'package:flutter/material.dart';
import 'package:transparent_image/transparent_image.dart';
//...
class _MyHomePageState extends State<MyHomePage> {
//...
Widget _gridList() {
return GridView.builder(
itemCount: 60,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.all(3.0),
child: GestureDetector(
child: FadeInImage.memoryNetwork(
placeholder: kTransparentImage,
image: 'https://picsum.photos/id/$index/128'),
onTap: () {
_openImage(context, index);
},
),
);
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.