Skip to content

Instantly share code, notes, and snippets.

@ookami-kb
Last active September 1, 2021 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ookami-kb/fe34f5c07d8a1b567da59d93077247fa to your computer and use it in GitHub Desktop.
Save ookami-kb/fe34f5c07d8a1b567da59d93077247fa to your computer and use it in GitHub Desktop.
flutter-endless-image-feed
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Flutter Demo Home Page'),
),
body: ListView.builder(
itemBuilder: (context, index) => Container(
decoration: BoxDecoration(border: Border.all()),
margin: const EdgeInsets.all(16),
height: 200,
child: Image.network(
'https://picsum.photos/seed/${index + 1}/1200/800',
key: ValueKey(index),
fit: BoxFit.cover,
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment