Created
May 12, 2020 15:57
-
-
Save swavkulinski/cf23f0609e8b2c563d293f75ec320013 to your computer and use it in GitHub Desktop.
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()); | |
final data = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20] | |
.map((x) => {'name':' Dart $x'}).toList(); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.green, | |
), | |
home: MyHomePage(title: 'Flutter Demo Home Page'), | |
); | |
} | |
} | |
class MyHomePage extends StatelessWidget { | |
MyHomePage({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
Widget build(BuildContext context) => Scaffold( | |
appBar: AppBar( | |
title: Text(title), | |
), | |
body: Center( | |
child: ListView.builder( | |
itemCount: data.length, | |
itemBuilder: (context, index) => Row( | |
children: <Widget>[ | |
Padding( | |
padding: EdgeInsets.all(10), | |
child: Center( | |
child: Text('${data[index]["name"]}'), | |
), | |
), | |
], | |
), | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment