From ed3d1a3d32b9b5b840ff8a2dbcd3cd81042bf698 Mon Sep 17 00:00:00 2001 From: fbachus Date: Fri, 31 Jul 2026 16:36:33 +0200 Subject: [PATCH] feat(ui): improve navigation and information --- lib/main.dart | 83 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 20 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 7496c41..2ad9a6d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -335,17 +335,26 @@ class _ChooseDeparturePageState extends State { ), ), ), - ElevatedButton( - onPressed: () { - if (widget.journeyId != null) { - loadJourney(widget.journeyId as int); - } - }, - child: const Text('Finish Route'), - ), + // ElevatedButton( + // onPressed: () { + // if (widget.journeyId != null) { + // loadJourney(widget.journeyId as int); + // } + // }, + // child: const Text('Finish Route'), + // ), ], ), ), + floatingActionButton: FloatingActionButton( + onPressed: () { + if (widget.journeyId != null) { + loadJourney(widget.journeyId as int); + } + }, + tooltip: 'Finish route', + child: const Icon(Icons.check), + ), ); } @@ -534,7 +543,31 @@ class _JourneyDetailPageState extends State { return Scaffold( appBar: AppBar(title: Text('Connection Details \n$duration')), body: Center( - child: SegmentList(journey: widget.singleJourney), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: SizedBox( + height: 400, + child: SegmentList(journey: widget.singleJourney), + ), + ), + Container( + margin: const EdgeInsets.all(20.0), + child: ElevatedButton( + onPressed: () { + Navigator.pop( + context, + MaterialPageRoute( + builder: (context) => JourneyOverviewPage(), + ), + ); + }, + child: const Text('View all Journeys'), + ), + ), + ], + ), ), ); } @@ -602,6 +635,16 @@ class _JourneyOverviewPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ + Container( + padding: EdgeInsets.only(left: 30, top: 50), + width: 500.0, + height: 100.0, + child: FittedBox( + fit: BoxFit.contain, + alignment: Alignment.centerLeft, + child: Text("Your Journeys"), + ), + ), FutureBuilder( future: loadJourneys(), builder: (context, snapshot) { @@ -654,17 +697,17 @@ class _JourneyOverviewPageState extends State { ); }, ), - ElevatedButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ChooseStationPage(), - ), - ); - }, - child: const Text('Start a route'), - ), + // ElevatedButton( + // onPressed: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => ChooseStationPage(), + // ), + // ); + // }, + // child: const Text('Start a route'), + // ), ], ), ),