/// Build-time configuration, supplied with `--dart-define-from-file=env.json`. /// /// Every value has a working default, so the app builds and runs with no /// `env.json` at all: it starts in demo mode against bundled mock frames, on /// the free OpenFreeMap base map, with no credentials anywhere. That keeps the /// repository free of secrets and keeps a fresh clone runnable. /// /// Values are `const` reads of `String.fromEnvironment` so they are inlined and /// tree-shaken; they cannot be read from a file at run time. library; class Env { const Env._(); /// Which region config to load from `assets/regions/.json`. static const String regionId = String.fromEnvironment( 'REGION_ID', defaultValue: 'piemonte', ); /// MapLibre style URL for the base map. /// /// Empty means the default OpenFreeMap style, which needs no key. Set it to /// point at another provider, or to [offlineStyle] to force the bundled /// no-network style. static const String mapStyleUrl = String.fromEnvironment('MAP_STYLE_URL'); /// Sentinel for `MAP_STYLE_URL` that selects the bundled offline style. static const String offlineStyle = 'offline'; static bool get wantsOfflineStyle => mapStyleUrl == offlineStyle; static bool get hasCustomMapStyle => mapStyleUrl.isNotEmpty && !wantsOfflineStyle; /// Base URL of the radar `manifest.json` published by our worker. /// /// Empty forces the mock radar source regardless of [radarSource]. static const String radarManifestUrl = String.fromEnvironment( 'RADAR_MANIFEST_URL', ); /// Radar adapter override: `mock`, `dpc` or `arpa`. /// /// Empty means "use whatever the region config says". static const String radarSource = String.fromEnvironment('RADAR_SOURCE'); /// True when nothing is configured and the radar is running entirely on /// bundled data. Surfaced in the UI so demo frames are never mistaken for a /// real observation. static bool get isDemoMode => radarManifestUrl.isEmpty; }