Page - Settings

Screen: AppRoute.settings File: Utiliship/Features/Settings/SettingsView.swift ViewModel: Utiliship/Features/Settings/SettingsViewModel.swift

Purpose

User preferences and account screen. Controls preferred currency (used as default across all features), measurement system (metric/imperial for Unit Converter smart defaults), theme, and Pro subscription. Shows device info, app version, and a support link. Pro users can restore purchases.

Component Tree

SettingsView
└── Form / List
    ├── preferenceSection
    │   ├── currencyPicker       — state.settings.preferredCurrency
    │   └── measurementSystemPicker — state.settings.measurementSystem
    ├── appearanceSection
    │   └── themePicker          — state.settings.theme (system/light/dark)
    ├── proSection
    │   ├── proStatusBadge       — state.isProUser
    │   ├── upgradeButton        — viewModel.purchasePro() (shown if not Pro)
    │   └── restorePurchasesButton — viewModel.restorePurchases()
    ├── aboutSection
    │   ├── versionRow           — state.appVersion + state.buildNumber
    │   ├── deviceRow            — state.deviceModel + state.iosVersion
    │   └── supportLink          — opens state.supportFormURL in webView
    └── .sheet → WebView (state.webViewURL)

ViewModel State

FieldTypeDescription
settingsUserSettingsFull settings model loaded from SettingsStore
isLoadingBoolTrue while loading initial settings from SettingsStore
errorString?Settings load or save error
availableCurrencies[Currency]All currencies for the picker
appVersionStringCFBundleShortVersionString from Info.plist
buildNumberStringCFBundleVersion from Info.plist
deviceModelStringUIDevice.current.model
iosVersionStringUIDevice.current.systemVersion
timeZoneStringTimeZone.current.identifier
supportFormURLURL?Support form URL loaded from config
webViewURLURL?URL to open in in-app web sheet
isProUserBoolCurrent Pro entitlement status from PurchaseService
proProductPurchaseProduct?StoreKit product info for the Pro upgrade
isLoadingProductBoolTrue while fetching StoreKit product
isPurchasingBoolTrue during StoreKit purchase flow
restoreResultMessageString?Shown after restore attempt

Data Flow