My working attempt to get the page going. Ran into weird issues trying to get it all centered. Going to see what the tutorial uses.

This commit is contained in:
Hyperling 2025-01-30 12:34:13 -07:00
parent ab0b551a64
commit acb6ed8599

View File

@ -64,7 +64,7 @@ class _MyHomePageState extends State<MyHomePage> {
page = GeneratorPage(); page = GeneratorPage();
break; break;
case 1: case 1:
page = Placeholder(); page = FavoritesPage();
break; break;
default: default:
throw UnimplementedError('no widget for $selectedIndex'); throw UnimplementedError('no widget for $selectedIndex');
@ -110,6 +110,28 @@ class _MyHomePageState extends State<MyHomePage> {
} }
} }
class FavoritesPage extends StatelessWidget {
const FavoritesPage({
super.key,
});
@override
Widget build(BuildContext context) {
var appState = context.watch<MyAppState>();
var textFields = <Text>[];
for (var fave in appState.favorites) {
textFields.add(Text(fave.toString()));
}
return Center(
child: ListView(
children: textFields,
),
);
}
}
class GeneratorPage extends StatelessWidget { class GeneratorPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {