Last active
September 1, 2021 12:36
-
-
Save ookami-kb/fe34f5c07d8a1b567da59d93077247fa to your computer and use it in GitHub Desktop.
flutter-endless-image-feed
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
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