mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-12 16:52:51 +00:00
tag node -> add node, better element offsets, fix splash background on iOS
This commit is contained in:
@@ -13,13 +13,20 @@ const double kDirectionConeHalfAngle = 30.0; // degrees
|
||||
const double kDirectionConeBaseLength = 0.001; // multiplier
|
||||
const Color kDirectionConeColor = Color(0xFF000000); // FOV cone color
|
||||
|
||||
// Margin (bottom) for positioning the floating bottom button bar
|
||||
const double kBottomButtonBarMargin = 4.0;
|
||||
// Bottom button bar positioning
|
||||
const double kBottomButtonBarOffset = 4.0; // Distance from screen bottom (above safe area)
|
||||
const double kButtonBarHeight = 60.0; // Button height (48) + padding (12)
|
||||
|
||||
// Map overlay (attribution, scale bar, zoom) vertical offset from bottom edge
|
||||
const double kAttributionBottomOffset = 110.0;
|
||||
const double kZoomIndicatorBottomOffset = 142.0;
|
||||
const double kScaleBarBottomOffset = 170.0;
|
||||
// Map overlay spacing relative to button bar top
|
||||
const double kAttributionSpacingAboveButtonBar = 10.0; // Attribution above button bar top
|
||||
const double kZoomIndicatorSpacingAboveButtonBar = 40.0; // Zoom indicator above button bar top
|
||||
const double kScaleBarSpacingAboveButtonBar = 70.0; // Scale bar above button bar top
|
||||
const double kZoomControlsSpacingAboveButtonBar = 20.0; // Zoom controls above button bar top
|
||||
|
||||
// Helper to calculate bottom position relative to button bar
|
||||
double bottomPositionFromButtonBar(double spacingAboveButtonBar, double safeAreaBottom) {
|
||||
return safeAreaBottom + kBottomButtonBarOffset + kButtonBarHeight + spacingAboveButtonBar;
|
||||
}
|
||||
|
||||
// Add Camera icon vertical offset (no offset needed since circle is centered)
|
||||
const double kAddPinYOffset = 0.0;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"title": "DeFlock"
|
||||
},
|
||||
"actions": {
|
||||
"tagNode": "Knoten Markieren",
|
||||
"tagNode": "Neuer Knoten",
|
||||
"download": "Herunterladen",
|
||||
"settings": "Einstellungen",
|
||||
"edit": "Bearbeiten",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"title": "DeFlock"
|
||||
},
|
||||
"actions": {
|
||||
"tagNode": "Tag Node",
|
||||
"tagNode": "New Node",
|
||||
"download": "Download",
|
||||
"settings": "Settings",
|
||||
"edit": "Edit",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"title": "DeFlock"
|
||||
},
|
||||
"actions": {
|
||||
"tagNode": "Etiquetar Nodo",
|
||||
"tagNode": "Nuevo Nodo",
|
||||
"download": "Descargar",
|
||||
"settings": "Configuración",
|
||||
"edit": "Editar",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"title": "DeFlock"
|
||||
},
|
||||
"actions": {
|
||||
"tagNode": "Marquer Nœud",
|
||||
"tagNode": "Nouveau Nœud",
|
||||
"download": "Télécharger",
|
||||
"settings": "Paramètres",
|
||||
"edit": "Modifier",
|
||||
|
||||
@@ -23,7 +23,7 @@ Future<void> main() async {
|
||||
// You can customize this splash/loading screen as needed
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
backgroundColor: Color(0xFF202020),
|
||||
backgroundColor: Color(0xFF152131),
|
||||
body: Center(
|
||||
child: Image.asset(
|
||||
'assets/app_icon.png',
|
||||
|
||||
@@ -201,7 +201,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).padding.bottom + kBottomButtonBarMargin,
|
||||
bottom: MediaQuery.of(context).padding.bottom + kBottomButtonBarOffset,
|
||||
left: 8,
|
||||
right: 8,
|
||||
),
|
||||
@@ -217,7 +217,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
)
|
||||
],
|
||||
),
|
||||
margin: EdgeInsets.only(bottom: kBottomButtonBarMargin),
|
||||
margin: EdgeInsets.only(bottom: kBottomButtonBarOffset),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
@@ -64,6 +64,9 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
|
||||
final nTiles = computeTileList(bounds, minZoom, maxZoom).length;
|
||||
final totalMb = (nTiles * kTileEstimateKb) / 1024.0;
|
||||
|
||||
// Debug logging to check calculation
|
||||
debugPrint('[DownloadDialog] Tiles: $nTiles, EstimateKb: $kTileEstimateKb, Total MB: $totalMb');
|
||||
|
||||
setState(() {
|
||||
_minZoom = minZoom;
|
||||
_maxPossibleZoom = maxPossibleZoom;
|
||||
|
||||
@@ -57,10 +57,10 @@ class MapOverlays extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
|
||||
// Zoom indicator, positioned above scale bar
|
||||
// Zoom indicator, positioned relative to button bar
|
||||
Positioned(
|
||||
left: 10,
|
||||
bottom: kZoomIndicatorBottomOffset,
|
||||
bottom: bottomPositionFromButtonBar(kZoomIndicatorSpacingAboveButtonBar, MediaQuery.of(context).padding.bottom),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
@@ -83,10 +83,10 @@ class MapOverlays extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
|
||||
// Attribution overlay
|
||||
// Attribution overlay, positioned relative to button bar
|
||||
if (attribution != null)
|
||||
Positioned(
|
||||
bottom: kAttributionBottomOffset,
|
||||
bottom: bottomPositionFromButtonBar(kAttributionSpacingAboveButtonBar, MediaQuery.of(context).padding.bottom),
|
||||
left: 10,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -104,9 +104,9 @@ class MapOverlays extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
|
||||
// Zoom and layer controls (bottom-right)
|
||||
// Zoom and layer controls (bottom-right), positioned relative to button bar
|
||||
Positioned(
|
||||
bottom: 80,
|
||||
bottom: bottomPositionFromButtonBar(kZoomControlsSpacingAboveButtonBar, MediaQuery.of(context).padding.bottom),
|
||||
right: 16,
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
@@ -332,10 +332,13 @@ class MapViewState extends State<MapView> {
|
||||
selectedTileType: appState.selectedTileType,
|
||||
),
|
||||
cameraLayers,
|
||||
// Built-in scale bar from flutter_map
|
||||
// Built-in scale bar from flutter_map, positioned relative to button bar
|
||||
Scalebar(
|
||||
alignment: Alignment.bottomLeft,
|
||||
padding: EdgeInsets.only(left: 8, bottom: kScaleBarBottomOffset), // from dev_config
|
||||
padding: EdgeInsets.only(
|
||||
left: 8,
|
||||
bottom: bottomPositionFromButtonBar(kScaleBarSpacingAboveButtonBar, MediaQuery.of(context).padding.bottom)
|
||||
),
|
||||
textStyle: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
|
||||
lineColor: Colors.black,
|
||||
strokeWidth: 3,
|
||||
|
||||
Reference in New Issue
Block a user