mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-05-15 05:30:33 +02:00
Optional navigation features
This commit is contained in:
@@ -41,6 +41,9 @@ const String kClientVersion = '1.0.2';
|
||||
// Development/testing features - set to false for production builds
|
||||
const bool kEnableDevelopmentModes = false; // Set to false to hide sandbox/simulate modes and force production mode
|
||||
|
||||
// Navigation features - set to false to hide navigation UI elements while in development
|
||||
const bool kEnableNavigationFeatures = kEnableDevelopmentModes; // Hide navigation until fully implemented
|
||||
|
||||
// Marker/node interaction
|
||||
const int kCameraMinZoomLevel = 10; // Minimum zoom to show nodes (Overpass)
|
||||
const int kOsmApiMinZoomLevel = 13; // Minimum zoom for OSM API bbox queries (sandbox mode)
|
||||
|
||||
@@ -433,13 +433,15 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
_editSheetShown = false;
|
||||
}
|
||||
|
||||
// Auto-open navigation sheet when needed - simplified logic
|
||||
final shouldShowNavSheet = appState.isInSearchMode || appState.showingOverview;
|
||||
if (shouldShowNavSheet && !_navigationSheetShown) {
|
||||
_navigationSheetShown = true;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => _openNavigationSheet());
|
||||
} else if (!shouldShowNavSheet) {
|
||||
_navigationSheetShown = false;
|
||||
// Auto-open navigation sheet when needed - simplified logic (only in dev mode)
|
||||
if (kEnableNavigationFeatures) {
|
||||
final shouldShowNavSheet = appState.isInSearchMode || appState.showingOverview;
|
||||
if (shouldShowNavSheet && !_navigationSheetShown) {
|
||||
_navigationSheetShown = true;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => _openNavigationSheet());
|
||||
} else if (!shouldShowNavSheet) {
|
||||
_navigationSheetShown = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Pass the active sheet height directly to the map
|
||||
@@ -498,15 +500,15 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
sheetHeight: activeSheetHeight,
|
||||
selectedNodeId: _selectedNodeId,
|
||||
onNodeTap: openNodeTagSheet,
|
||||
onSearchPressed: _onNavigationButtonPressed,
|
||||
onSearchPressed: kEnableNavigationFeatures ? _onNavigationButtonPressed : null,
|
||||
onUserGesture: () {
|
||||
if (appState.followMeMode != FollowMeMode.off) {
|
||||
appState.setFollowMeMode(FollowMeMode.off);
|
||||
}
|
||||
},
|
||||
),
|
||||
// Search bar (slides in when in search mode)
|
||||
if (appState.isInSearchMode)
|
||||
// Search bar (slides in when in search mode) - only in dev mode
|
||||
if (kEnableNavigationFeatures && appState.isInSearchMode)
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
|
||||
@@ -39,14 +39,17 @@ class SettingsScreen extends StatelessWidget {
|
||||
),
|
||||
const Divider(),
|
||||
|
||||
_buildNavigationTile(
|
||||
context,
|
||||
icon: Icons.navigation,
|
||||
title: locService.t('navigation.navigationSettings'),
|
||||
subtitle: locService.t('navigation.navigationSettingsSubtitle'),
|
||||
onTap: () => Navigator.pushNamed(context, '/settings/navigation'),
|
||||
),
|
||||
const Divider(),
|
||||
// Only show navigation settings in development builds
|
||||
if (kEnableNavigationFeatures) ...[
|
||||
_buildNavigationTile(
|
||||
context,
|
||||
icon: Icons.navigation,
|
||||
title: locService.t('navigation.navigationSettings'),
|
||||
subtitle: locService.t('navigation.navigationSettingsSubtitle'),
|
||||
onTap: () => Navigator.pushNamed(context, '/settings/navigation'),
|
||||
),
|
||||
const Divider(),
|
||||
],
|
||||
|
||||
_buildNavigationTile(
|
||||
context,
|
||||
|
||||
@@ -121,8 +121,8 @@ class MapOverlays extends StatelessWidget {
|
||||
builder: (context, appState, child) {
|
||||
return Column(
|
||||
children: [
|
||||
// Navigation button - simplified logic
|
||||
if (onSearchPressed != null && (appState.showSearchButton || appState.showRouteButton))
|
||||
// Navigation button - simplified logic (only show in dev mode)
|
||||
if (kEnableNavigationFeatures && onSearchPressed != null && (appState.showSearchButton || appState.showRouteButton)) ...[
|
||||
FloatingActionButton(
|
||||
mini: true,
|
||||
heroTag: "search_nav",
|
||||
@@ -132,8 +132,8 @@ class MapOverlays extends StatelessWidget {
|
||||
: LocalizationService.instance.t('navigation.searchLocation'),
|
||||
child: Icon(appState.showRouteButton ? Icons.route : Icons.search),
|
||||
),
|
||||
if (onSearchPressed != null && (appState.showSearchButton || appState.showRouteButton))
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
|
||||
// Layer selector button
|
||||
const LayerSelectorButton(),
|
||||
|
||||
Reference in New Issue
Block a user