Skip to content

Instantly share code, notes, and snippets.

@Lesliecalvillo
Created May 6, 2021 23:52
Show Gist options
  • Save Lesliecalvillo/71768d23668facd7c67ff8ade4cc52b4 to your computer and use it in GitHub Desktop.
Save Lesliecalvillo/71768d23668facd7c67ff8ade4cc52b4 to your computer and use it in GitHub Desktop.
app movil No.lista
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
}
}
@Lesliecalvillo
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment