Your question is quite confusing. Is this what you are looking for?
import 'package:flutter/material.dart';
main() {
runApp(new MaterialApp(
title: 'Flutter Example',
home: new MaterialApp(
home: new Scaffold(
appBar: new AppBar(title: new Text("Flutter Example"),),
body: new MyApp(),
),
),
));
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<ColumnItem> items = [];
// creates ColumnItems to display
for (var i = 0; i < 40; i++) {
items.add(
new ColumnItem(title: "This is a title", description: "Descriptions are usefull",)
);
}
return new ListView(
children: items,
);
}
}
class ColumnItem extends StatelessWidget {
final String title;
final String description;
const ColumnItem({this.title, this.description});
@override
Widget build(BuildContext context) {
return new Column(
children: <Widget>[
new Text(this.title, style: new TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold),),
new Text(this.description)
],
);
}
}
Edit: Upon further reading your question, maybe this is what you are trying to do?
import 'package:flutter/material.dart';
main() {
runApp(new MaterialApp(
title: 'Flutter Example',
home: new MaterialApp(
home: new Scaffold(
appBar: new AppBar(title: new Text("Flutter Example"),),
body: new MyApp(),
),
),
));
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<ColumnItem> items = [];
// creates ColumnItems to display
for (var i = 0; i < 40; i++) {
items.add(
new ColumnItem(title: "This is a title", description: "Descriptions are usefull",)
);
}
return new Column(
children: [
new Text("Static Title", style: new TextStyle(fontSize: 30.0, fontWeight: FontWeight.bold), ),
new Text("This is a static desctription"),
new Divider(),
new Expanded(
child: new ListView(children: items) ,
)
],
);
}
}
class ColumnItem extends StatelessWidget {
final String title;
final String description;
const ColumnItem({this.title, this.description});
@override
Widget build(BuildContext context) {
return new Column(
children: <Widget>[
new Text(this.title, style: new TextStyle(fontSize: 17.0, fontWeight: FontWeight.bold),),
new Text(this.description)
],
);
}
}