use more fitting floating action button, cleanup
All checks were successful
Build and release APK / Build APK (pull_request) Successful in 5m24s

This commit is contained in:
Remy Moll 2024-08-10 17:14:56 +02:00
parent 22ca038017
commit 6d3399640e
9 changed files with 40 additions and 56 deletions

View File

@ -11,7 +11,7 @@ import 'package:anyway/utils/load_trips.dart';
import 'package:anyway/pages/new_trip.dart';
import 'package:anyway/pages/tutorial.dart';
import 'package:anyway/pages/trip.dart';
import 'package:anyway/pages/current_trip.dart';
import 'package:anyway/pages/profile.dart';

View File

@ -77,6 +77,9 @@ class _MapWidgetState extends State<MapWidget> {
// onLongPress: ,
markers: mapMarkers,
cloudMapId: MAP_ID,
mapToolbarEnabled: false,
zoomControlsEnabled: false,
);
}
}

View File

@ -25,52 +25,38 @@ class _NewTripButtonState extends State<NewTripButton> {
if (widget.trip.landmarks.isEmpty){
return Container();
}
return SizedBox(
width: 200,
child: ElevatedButton(
onPressed: () async {
Future<UserPreferences> preferences = loadUserPreferences();
Trip trip = widget.trip;
fetchTrip(trip, preferences);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => BasePage(mainScreen: "map", trip: trip)
)
);
return FloatingActionButton.extended(
onPressed: () async {
Future<UserPreferences> preferences = loadUserPreferences();
Trip trip = widget.trip;
fetchTrip(trip, preferences);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => BasePage(mainScreen: "map", trip: trip)
)
);
},
icon: Icon(Icons.add),
label: FutureBuilder(
future: widget.trip.cityName,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return AutoSizeText(
'New trip to ${snapshot.data.toString()}',
style: TextStyle(fontSize: 18),
maxLines: 2,
);
} else {
return AutoSizeText(
'New trip to ...',
style: TextStyle(fontSize: 18),
maxLines: 2,
);
}
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.add,
),
Expanded(
child: Padding(
padding: EdgeInsets.only(left: 10, top: 5, bottom: 5, right: 5),
child: FutureBuilder(
future: widget.trip.cityName,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return AutoSizeText(
'New trip to ${snapshot.data.toString()}',
style: TextStyle(fontSize: 18),
maxLines: 2,
);
} else {
return AutoSizeText(
'New trip to ...',
style: TextStyle(fontSize: 18),
maxLines: 2,
);
}
},
)
)
)
],
),
),
)
);
}
);
}

View File

@ -81,6 +81,7 @@ class _NewTripMapState extends State<NewTripMap> {
markers: _markers,
cloudMapId: MAP_ID,
mapToolbarEnabled: false,
zoomControlsEnabled: false,
);
}
}

View File

@ -1,11 +1,11 @@
import 'package:anyway/modules/save_button.dart';
import 'package:anyway/modules/current_trip_save_button.dart';
import 'package:flutter/material.dart';
import 'package:sliding_up_panel/sliding_up_panel.dart';
import 'package:anyway/structs/trip.dart';
import 'package:anyway/modules/landmarks_list.dart';
import 'package:anyway/modules/greeter.dart';
import 'package:anyway/modules/map.dart';
import 'package:anyway/modules/current_trip_landmarks_list.dart';
import 'package:anyway/modules/current_trip_greeter.dart';
import 'package:anyway/modules/current_trip_map.dart';

View File

@ -38,15 +38,9 @@ class _NewTripPageState extends State<NewTripPage> {
padding: EdgeInsets.all(15),
child: NewTripLocationSearch(trip),
),
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: EdgeInsets.all(15),
child: NewTripButton(trip: trip)
),
),
],
),
floatingActionButton: NewTripButton(trip: trip),
);
}
}