MapSettingsService class
Service for loading and saving map display settings.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getStartupViewport(
MapSettings settings) → Future< ViewportPosition> - Gets the initial viewport based on settings. If rememberViewport is ON, returns last viewport if available. Otherwise returns the configured initial viewport.
-
loadSettings(
) → Future< MapSettings> - Loads settings from SharedPreferences (fast, non-blocking). POD sync is done separately via syncFromPod().
-
loadSettingsSmart(
) → Future< MapSettings> - Smart load: if no local cache, try POD first (for first login). Otherwise load from local cache (fast).
-
resetToDefaults(
) → Future< bool> - Resets all settings to defaults.
-
saveSettings(
MapSettings settings) → Future< bool> - Saves settings to SharedPreferences only (fast, no network). POD sync is done separately via syncToPod() when needed.
-
startBackgroundSync(
{void onSettingsUpdated(MapSettings)?}) → void -
Start background sync from POD.
This is non-blocking and updates settings silently.
onSettingsUpdatedis called if POD has newer settings. -
syncFromPod(
) → Future< MapSettings?> - Sync settings from POD to local (background, non-blocking). Call this after login to ensure local settings match POD. Returns the synced settings if POD has data, null otherwise.
-
syncToPod(
) → Future< bool> - Manually sync current settings to POD. Call this when user closes settings dialog or at app exit.