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/new_trip.dart';
import 'package:anyway/pages/tutorial.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'; import 'package:anyway/pages/profile.dart';

View File

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

View File

@ -25,9 +25,7 @@ class _NewTripButtonState extends State<NewTripButton> {
if (widget.trip.landmarks.isEmpty){ if (widget.trip.landmarks.isEmpty){
return Container(); return Container();
} }
return SizedBox( return FloatingActionButton.extended(
width: 200,
child: ElevatedButton(
onPressed: () async { onPressed: () async {
Future<UserPreferences> preferences = loadUserPreferences(); Future<UserPreferences> preferences = loadUserPreferences();
Trip trip = widget.trip; Trip trip = widget.trip;
@ -38,16 +36,8 @@ class _NewTripButtonState extends State<NewTripButton> {
) )
); );
}, },
child: Row( icon: Icon(Icons.add),
mainAxisAlignment: MainAxisAlignment.center, label: FutureBuilder(
children: [
Icon(
Icons.add,
),
Expanded(
child: Padding(
padding: EdgeInsets.only(left: 10, top: 5, bottom: 5, right: 5),
child: FutureBuilder(
future: widget.trip.cityName, future: widget.trip.cityName,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
@ -65,12 +55,8 @@ class _NewTripButtonState extends State<NewTripButton> {
} }
}, },
) )
)
)
],
),
),
); );
} }
); );
} }

View File

@ -81,6 +81,7 @@ class _NewTripMapState extends State<NewTripMap> {
markers: _markers, markers: _markers,
cloudMapId: MAP_ID, cloudMapId: MAP_ID,
mapToolbarEnabled: false, 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:flutter/material.dart';
import 'package:sliding_up_panel/sliding_up_panel.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart';
import 'package:anyway/structs/trip.dart'; import 'package:anyway/structs/trip.dart';
import 'package:anyway/modules/landmarks_list.dart'; import 'package:anyway/modules/current_trip_landmarks_list.dart';
import 'package:anyway/modules/greeter.dart'; import 'package:anyway/modules/current_trip_greeter.dart';
import 'package:anyway/modules/map.dart'; import 'package:anyway/modules/current_trip_map.dart';

View File

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