reworked page layout inheritence

This commit is contained in:
2025-02-15 19:36:41 +01:00
parent 8f6dfd404d
commit 56c55883ea
21 changed files with 278 additions and 278 deletions

View File

@@ -1,5 +1,5 @@
import 'package:anyway/constants.dart';
import 'package:anyway/pages/base_page.dart';
import 'package:anyway/layouts/scaffold.dart';
import 'package:flutter/material.dart';
import 'package:sliding_up_panel/sliding_up_panel.dart';
@@ -28,12 +28,13 @@ class TripPage extends StatefulWidget {
class _TripPageState extends State<TripPage> {
class _TripPageState extends State<TripPage> with ScaffoldLayout{
@override
Widget build(BuildContext context) {
return BasePage(
mainScreen: SlidingUpPanel(
return mainScaffold(
context,
child: SlidingUpPanel(
// use panelBuilder instead of panel so that we can reuse the scrollcontroller for the listview
panelBuilder: (scrollcontroller) => CurrentTripPanel(controller: scrollcontroller, trip: widget.trip),
// using collapsed and panelBuilder seems to show both at the same time, so we include the greeter in the panelBuilder
@@ -58,9 +59,13 @@ class _TripPageState extends State<TripPage> {
title: FutureBuilder(
future: widget.trip.cityName,
builder: (context, snapshot) => Text(
'Your trip to ${snapshot.hasData ? snapshot.data! : "..."}',
'Trip to ${snapshot.hasData ? snapshot.data! : "..."}',
)
),
helpTexts: [
'Current trip',
'You can see and edit your current trip here. Swipe up from the bottom to see a detailed view of the recommendations.'
],
);
}
}