Skip to content

Instantly share code, notes, and snippets.

@pk102
Last active June 5, 2018 19:42
Show Gist options
  • Save pk102/b8f13c002b3343cfafb8ec2c94a38d3e to your computer and use it in GitHub Desktop.
Save pk102/b8f13c002b3343cfafb8ec2c94a38d3e to your computer and use it in GitHub Desktop.
list rendering issue
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