Created
May 6, 2021 23:52
-
-
Save Lesliecalvillo/71768d23668facd7c67ff8ade4cc52b4 to your computer and use it in GitHub Desktop.
app movil No.lista
This file contains 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( | |
items: List<String>.generate(100, (i) => "List Item $i"), | |
)); | |
} | |
class MyApp extends StatelessWidget { | |
final List<String> items; | |
MyApp({Key key, @required this.items}) : super(key: key); | |
Widget build(BuildContext context) { | |
final title = 'Listview Index'; | |
return MaterialApp( | |
title: title, | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text(title), | |
), | |
body: | |
ListView.separated( | |
itemCount: 25, | |
separatorBuilder: (BuildContext context, int index) => Divider(), | |
itemBuilder: (BuildContext context, int index) { | |
return ListTile( | |
title: Text('${items[index]}'), | |
);//ListTile | |
}, | |
)//Listview.builder | |
),//Scaffold | |
);//MaterialApp | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
listado de numeros
https://dartpad.dev/71768d23668facd7c67ff8ade4cc52b4