From d9beeb9d834b0a4bade160cb6a6b9a1603cf0b52 Mon Sep 17 00:00:00 2001 From: stopflock Date: Sun, 17 Aug 2025 12:13:57 -0500 Subject: [PATCH] Revert "Move tag camera and download buttons to a bar instead of floating" This reverts commit 6aaddb4fe2a5eff902f5a96640c2f65eeadbd5f3. --- lib/dev_config.dart | 5 --- lib/screens/home_screen.dart | 64 +++++++++++++----------------------- lib/widgets/map_view.dart | 6 ++-- 3 files changed, 25 insertions(+), 50 deletions(-) diff --git a/lib/dev_config.dart b/lib/dev_config.dart index 5e6f0ea..bfa8f52 100644 --- a/lib/dev_config.dart +++ b/lib/dev_config.dart @@ -13,11 +13,6 @@ const double kDirectionConeBaseLength = 0.0012; // multiplier // Add Camera pin vertical offset (for pin tip to match coordinate on map) const double kAddPinYOffset = -16.0; -// Bottom overlay vertical positions (distance from bottom of screen) -const double kAttributionBottom = 5.0; -const double kScaleBarBottom = 40.0; -const double kZoomIndicatorBottom = 70.0; - // Client name and version for OSM uploads ("created_by" tag) const String kClientName = 'FlockMap'; const String kClientVersion = '0.8.1'; diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 3476e5c..f6b9189 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -27,12 +27,10 @@ class _HomeScreenState extends State { void _openAddCameraSheet() { final appState = context.read(); appState.startAddSession(); - final session = appState.session!; // guaranteed non‑null now + final session = appState.session!; // guaranteed non‑null now - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (ctx) => AddCameraSheet(session: session), + _scaffoldKey.currentState!.showBottomSheet( + (ctx) => AddCameraSheet(session: session), ); } @@ -68,49 +66,31 @@ class _HomeScreenState extends State { if (_followMe) setState(() => _followMe = false); }, ), - bottomNavigationBar: BottomAppBar( - elevation: 10, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: ElevatedButton.icon( + floatingActionButton: appState.session == null + ? Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + FloatingActionButton.extended( + onPressed: _openAddCameraSheet, icon: const Icon(Icons.add_location_alt), label: const Text('Tag Camera'), - onPressed: () { - if (appState.session == null) { - _openAddCameraSheet(); - } - }, - style: ElevatedButton.styleFrom( - minimumSize: const Size(0, 48), - textStyle: const TextStyle(fontSize: 16), - ), + heroTag: 'tag_camera_fab', ), - ), - const SizedBox(width: 12), - Expanded( - child: ElevatedButton.icon( + const SizedBox(height: 12), + FloatingActionButton.extended( + onPressed: () => showDialog( + context: context, + builder: (ctx) => DownloadAreaDialog(controller: _mapController), + ), icon: const Icon(Icons.download_for_offline), label: const Text('Download'), - onPressed: appState.session == null - ? () => showDialog( - context: context, - builder: (ctx) => DownloadAreaDialog(controller: _mapController), - ) - : null, // Disabled while camera sheet active - style: ElevatedButton.styleFrom( - minimumSize: const Size(0, 48), - textStyle: const TextStyle(fontSize: 16), - ), + heroTag: 'download_fab', ), - ), - ], - ), - ), - ), + ], + ) + : null, + floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, ), ); } diff --git a/lib/widgets/map_view.dart b/lib/widgets/map_view.dart index dce7e5a..6313664 100644 --- a/lib/widgets/map_view.dart +++ b/lib/widgets/map_view.dart @@ -311,7 +311,7 @@ class _MapViewState extends State { // Built-in scale bar from flutter_map Scalebar( alignment: Alignment.bottomLeft, - padding: EdgeInsets.only(left: 8, bottom: kScaleBarBottom), // from dev_config, above attribution & BottomAppBar + padding: EdgeInsets.only(left: 8, bottom: 54), // above attribution textStyle: TextStyle(color: Colors.black, fontWeight: FontWeight.bold), lineColor: Colors.black, strokeWidth: 3, @@ -353,7 +353,7 @@ class _MapViewState extends State { // Zoom indicator, positioned above scale bar Positioned( left: 10, - bottom: kZoomIndicatorBottom, // from dev_config + bottom: 92, child: Container( padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2), decoration: BoxDecoration( @@ -377,7 +377,7 @@ class _MapViewState extends State { ), // Attribution overlay Positioned( - bottom: kAttributionBottom, // from dev_config + bottom: 20, left: 10, child: Container( color: Colors.white70,