diff --git a/namer_app/lib/main.dart b/namer_app/lib/main.dart index 3ef3c9f..952214a 100644 --- a/namer_app/lib/main.dart +++ b/namer_app/lib/main.dart @@ -119,15 +119,25 @@ class FavoritesPage extends StatelessWidget { Widget build(BuildContext context) { var appState = context.watch(); - var textFields = []; - for (var fave in appState.favorites) { - textFields.add(Text(fave.toString())); + if (appState.favorites.isEmpty) { + return Center( + child: Text('No favorites yet.'), + ); } - return Center( - child: ListView( - children: textFields, - ), + return ListView( + children: [ + Padding( + padding: const EdgeInsets.all(20), + child: Text('You have ' + '${appState.favorites.length} favorites:'), + ), + for (var pair in appState.favorites) + ListTile( + leading: Icon(Icons.favorite), + title: Text(pair.asLowerCase), + ), + ], ); } }