Troubleshooting
The failures developers meet first with the Dart SDK, each with its fix.
SecretCredential and constructWebhookEvent exist on the Dart VM only. A Flutter build leaves them out, so a secret key cannot ship inside an app. Mint session tokens and verify webhooks on your server, and give the app a publishable key with a SessionTokenEngine.
The key is empty or misprefixed. String.fromEnvironment answers '' when the build was not given the value:
Check that .env holds MOUNTAYA_PUBLISHABLE_KEY=pk_…, and rebuild: the value is compiled in.
The Data API answers a publishable key only beside a live session token. A token held as a value expires in minutes: give the client a SessionTokenEngine, which mints again before it does:
Flutter's template grants the network to debug builds only. Declare it in android/app/src/main/AndroidManifest.xml:
The map plugin needs iOS 15.5 and Android API level 24, the navigation plugin iOS 14.0 and API level 24. Raise the Runner target's Minimum Deployments in Xcode, platform :ios in ios/Podfile, and minSdk in android/app/build.gradle.kts, as Install and set up shows.
A map takes a publishable key alone, with a session token as a value or a SessionTokenEngine, or a share token. It refuses a secret key, and a session token read by a function, with ConfigurationException. Build the map's client with .source(sessions) or .value(token).
map.state.isAccessRequired is true and events() tells a MapEventAccessRefused. The key lacks a scope: tiles draws the map, publishing reads an itinerary. Add the scope under Organization → API keys in the Mountaya app.
A panel opens in the nearest Overlay. A Navigator provides one; under a bare WidgetsApp with a builder, wrap the screen in one:
A write to an itinerary, a collection or a zone acts as a member. Mint its token with user_id and surface: rest_schema.SessionSurface.studioEmbedded, beside a key carrying the studio-embedded scope, as Act as a member shows.
A BillingException means your agreement does not cover the call, or a payment is missing. Its message says which: change the product with Mountaya, or add a payment method in your billing settings. Code cannot fix it.
constructWebhookEvent throws WebhookSignatureException, and its reason says why. A signature reason means the body changed or the secret is wrong: pass the body exactly as it arrived, and the secret of the endpoint the delivery was sent to. A timestamp reason means your server's clock is off.
The engine speaks only through the voice you hand it, and only the instructions your words function answers. Hand DeviceNavigationEngine(voice:) a SpeechNavigationVoice, give it an onError, and answer a sentence for each key you use, as Speak the prompts shows.
The profile, the waypoint table and the card write a cut-off only through your formatCutoffAt, in the device's time zone. Read it with deviceTimeZone() and write with formatDateTime, as Show services and cut-offs shows.
DeviceLocationSource reads only while your app holds location access at full accuracy, and never asks for it. Ask in your own flow, declare the purpose string and permissions (use the device's location), then call recheckPermission().