Last active
June 5, 2018 19:42
-
-
Save pk102/b8f13c002b3343cfafb8ec2c94a38d3e to your computer and use it in GitHub Desktop.
list rendering issue
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(new MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', | |
theme: new ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: new SelectScreen(), | |
); | |
} | |
} | |
class SelectScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
body: new Center( | |
child: new Container( | |
height: 330.0, | |
child: new Scrollbar( | |
child: new ListView( | |
children: new List.generate(10, (int index) { | |
return new ListTile( | |
title: new Text("$index"), | |
); | |
}))), | |
padding: const EdgeInsets.only(left: 20.0, right: 20.0), | |
))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment