Skip to content

Commit

Permalink
Added title and subtitle tile
Browse files Browse the repository at this point in the history
Added better tiles and subtiles
  • Loading branch information
martin-headspace committed Feb 17, 2020
1 parent 1f996cd commit f283fc6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions eight_queens/lib/results.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ class _ResultsPageState extends State<ResultsPage> {
super.initState();
});
}

Widget ResultItem(BuildContext context, int index) {
String todisplay = "";
for(int x = 0; x < boards[index].length; x++ ){
todisplay += boards[index][x].toString();
todisplay+= "\n";
}
return Text(todisplay);
}

@override
Widget build(BuildContext context) {
Expand All @@ -47,12 +56,12 @@ class _ResultsPageState extends State<ResultsPage> {
body: new ListView.builder(
itemCount: boards.length ?? 0,
itemBuilder: (BuildContext context, int index) {
String todisplay = "";
for(int x = 0; x < boards[index].length; x++ ){
todisplay += boards[index][x].toString();
todisplay+= "\n";
}
return Text(todisplay);
return ListTile(
title: Text('Result ${index+1}'),
subtitle: Container(
child: ResultItem(context, index)
),
);
},
)
);
Expand Down

0 comments on commit f283fc6

Please sign in to comment.