diff --git a/lib/main.dart b/lib/main.dart index 55f552d..0417cfd 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,7 +11,6 @@ Future main() async { class MyApp extends StatelessWidget { const MyApp({super.key}); - // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( @@ -36,6 +35,9 @@ class StatsPage extends StatelessWidget { @override Widget build(BuildContext context) { // todo : add global statistics + // todo : demand stat + // todo : stat on origin + destination + return Scaffold( body: FutureBuilder( future: _fetchData(), @@ -81,7 +83,9 @@ class FlowsPage extends StatelessWidget { @override Widget build(BuildContext context) { - // todo : add locations tree view + // todo : add flow list + // todo : flows by item produced + // todo : flow page return const Scaffold(); } } @@ -114,12 +118,10 @@ class ItemsPage extends StatelessWidget { var items = snapshot.data!; - return GridView.count( - crossAxisCount: 2, - children: items.map((x) { - return ItemCard(x); - }).toList(), - ); + return ListView( + children: items.map((x) { + return ItemTile(x); + }).toList()); }), ); } @@ -168,26 +170,19 @@ class _MyHomePageState extends State { } } -class ItemCard extends StatelessWidget { +class ItemTile extends StatelessWidget { final String item; - const ItemCard(this.item, {super.key}); + const ItemTile(this.item, {super.key}); @override Widget build(BuildContext context) { - return InkWell( + return ListTile( onTap: () { API().getItem(item).then((itemInfo) => Navigator.push(context, MaterialPageRoute(builder: (context) => ItemView(item: itemInfo)))); }, - child: Row(children: [ - /*Image.network( - API().getImageURL(item), - width: 128, - height: 128, - ),*/ - Text(item) - ]), + title: Text(item), ); } }