mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-09-27 03:21:43 +02:00
Move tag camera and download buttons to a bar instead of floating
This commit is contained in:
@@ -13,6 +13,11 @@ const double kDirectionConeBaseLength = 0.0012; // multiplier
|
|||||||
// Add Camera pin vertical offset (for pin tip to match coordinate on map)
|
// Add Camera pin vertical offset (for pin tip to match coordinate on map)
|
||||||
const double kAddPinYOffset = -16.0;
|
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)
|
// Client name and version for OSM uploads ("created_by" tag)
|
||||||
const String kClientName = 'FlockMap';
|
const String kClientName = 'FlockMap';
|
||||||
const String kClientVersion = '0.8.1';
|
const String kClientVersion = '0.8.1';
|
||||||
|
|||||||
@@ -27,10 +27,12 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
void _openAddCameraSheet() {
|
void _openAddCameraSheet() {
|
||||||
final appState = context.read<AppState>();
|
final appState = context.read<AppState>();
|
||||||
appState.startAddSession();
|
appState.startAddSession();
|
||||||
final session = appState.session!; // guaranteed non‑null now
|
final session = appState.session!; // guaranteed non‑null now
|
||||||
|
|
||||||
_scaffoldKey.currentState!.showBottomSheet(
|
showModalBottomSheet(
|
||||||
(ctx) => AddCameraSheet(session: session),
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: (ctx) => AddCameraSheet(session: session),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,31 +68,49 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
if (_followMe) setState(() => _followMe = false);
|
if (_followMe) setState(() => _followMe = false);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: appState.session == null
|
bottomNavigationBar: BottomAppBar(
|
||||||
? Column(
|
elevation: 10,
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
children: [
|
child: Row(
|
||||||
FloatingActionButton.extended(
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
onPressed: _openAddCameraSheet,
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ElevatedButton.icon(
|
||||||
icon: const Icon(Icons.add_location_alt),
|
icon: const Icon(Icons.add_location_alt),
|
||||||
label: const Text('Tag Camera'),
|
label: const Text('Tag Camera'),
|
||||||
heroTag: 'tag_camera_fab',
|
onPressed: () {
|
||||||
),
|
if (appState.session == null) {
|
||||||
const SizedBox(height: 12),
|
_openAddCameraSheet();
|
||||||
FloatingActionButton.extended(
|
}
|
||||||
onPressed: () => showDialog(
|
},
|
||||||
context: context,
|
style: ElevatedButton.styleFrom(
|
||||||
builder: (ctx) => DownloadAreaDialog(controller: _mapController),
|
minimumSize: const Size(0, 48),
|
||||||
|
textStyle: const TextStyle(fontSize: 16),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: ElevatedButton.icon(
|
||||||
icon: const Icon(Icons.download_for_offline),
|
icon: const Icon(Icons.download_for_offline),
|
||||||
label: const Text('Download'),
|
label: const Text('Download'),
|
||||||
heroTag: 'download_fab',
|
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),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
)
|
],
|
||||||
: null,
|
),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ class _MapViewState extends State<MapView> {
|
|||||||
// Built-in scale bar from flutter_map
|
// Built-in scale bar from flutter_map
|
||||||
Scalebar(
|
Scalebar(
|
||||||
alignment: Alignment.bottomLeft,
|
alignment: Alignment.bottomLeft,
|
||||||
padding: EdgeInsets.only(left: 8, bottom: 54), // above attribution
|
padding: EdgeInsets.only(left: 8, bottom: kScaleBarBottom), // from dev_config, above attribution & BottomAppBar
|
||||||
textStyle: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
|
textStyle: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
|
||||||
lineColor: Colors.black,
|
lineColor: Colors.black,
|
||||||
strokeWidth: 3,
|
strokeWidth: 3,
|
||||||
@@ -353,7 +353,7 @@ class _MapViewState extends State<MapView> {
|
|||||||
// Zoom indicator, positioned above scale bar
|
// Zoom indicator, positioned above scale bar
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 10,
|
left: 10,
|
||||||
bottom: 92,
|
bottom: kZoomIndicatorBottom, // from dev_config
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2),
|
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -377,7 +377,7 @@ class _MapViewState extends State<MapView> {
|
|||||||
),
|
),
|
||||||
// Attribution overlay
|
// Attribution overlay
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 20,
|
bottom: kAttributionBottom, // from dev_config
|
||||||
left: 10,
|
left: 10,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white70,
|
color: Colors.white70,
|
||||||
|
|||||||
Reference in New Issue
Block a user