itemview listview
This commit is contained in:
parent
ca68b8e951
commit
53bfe1763c
1 changed files with 14 additions and 19 deletions
|
@ -11,7 +11,6 @@ Future<void> main() async {
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
const MyApp({super.key});
|
const MyApp({super.key});
|
||||||
|
|
||||||
// This widget is the root of your application.
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
|
@ -36,6 +35,9 @@ class StatsPage extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// todo : add global statistics
|
// todo : add global statistics
|
||||||
|
// todo : demand stat
|
||||||
|
// todo : stat on origin + destination
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: FutureBuilder(
|
body: FutureBuilder(
|
||||||
future: _fetchData(),
|
future: _fetchData(),
|
||||||
|
@ -81,7 +83,9 @@ class FlowsPage extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// todo : add locations tree view
|
// todo : add flow list
|
||||||
|
// todo : flows by item produced
|
||||||
|
// todo : flow page
|
||||||
return const Scaffold();
|
return const Scaffold();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,12 +118,10 @@ class ItemsPage extends StatelessWidget {
|
||||||
|
|
||||||
var items = snapshot.data!;
|
var items = snapshot.data!;
|
||||||
|
|
||||||
return GridView.count(
|
return ListView(
|
||||||
crossAxisCount: 2,
|
|
||||||
children: items.map((x) {
|
children: items.map((x) {
|
||||||
return ItemCard(x);
|
return ItemTile(x);
|
||||||
}).toList(),
|
}).toList());
|
||||||
);
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -168,26 +170,19 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ItemCard extends StatelessWidget {
|
class ItemTile extends StatelessWidget {
|
||||||
final String item;
|
final String item;
|
||||||
|
|
||||||
const ItemCard(this.item, {super.key});
|
const ItemTile(this.item, {super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
API().getItem(item).then((itemInfo) => Navigator.push(context,
|
API().getItem(item).then((itemInfo) => Navigator.push(context,
|
||||||
MaterialPageRoute(builder: (context) => ItemView(item: itemInfo))));
|
MaterialPageRoute(builder: (context) => ItemView(item: itemInfo))));
|
||||||
},
|
},
|
||||||
child: Row(children: [
|
title: Text(item),
|
||||||
/*Image.network(
|
|
||||||
API().getImageURL(item),
|
|
||||||
width: 128,
|
|
||||||
height: 128,
|
|
||||||
),*/
|
|
||||||
Text(item)
|
|
||||||
]),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue