Public Access
feat(ui): add page to show an overview of all journeys
This commit is contained in:
+45
-1
@@ -502,4 +502,48 @@ class SegmentList extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class JourneyOverviewPage extends StatefulWidget {
|
||||
const JourneyOverviewPage({super.key});
|
||||
@override
|
||||
State<JourneyOverviewPage> createState() => _JourneyOverviewPageState();
|
||||
}
|
||||
|
||||
class _JourneyOverviewPageState extends State<JourneyOverviewPage> {
|
||||
List<Journey> allJourneys = <Journey>[];
|
||||
|
||||
@override
|
||||
initState() async {
|
||||
super.initState();
|
||||
// TODO: implement batch query to get a list (all) of journeys
|
||||
//allJourneys = await Journey.dbGetAll();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: JourneyList(journeys: allJourneys),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class JourneyList extends StatelessWidget {
|
||||
final List<Journey> journeys;
|
||||
const JourneyList({
|
||||
super.key,
|
||||
required this.journeys,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
children: [
|
||||
for (Journey jour in journeys)
|
||||
ListTile(title: Text('${jour.startStation} to ${jour.endStation}')),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user