mapzone_nav_speed_alert 2.0.0
mapzone_nav_speed_alert: ^2.0.0 copied to clipboard
Speed-limit, camera, toll and road-restriction alerts with voice along a given route, for Flutter navigation apps on Android and iOS.
2.0.0 #
Native SDK 2.0.1: signed-in accounts. See the README section Migrating from 1.0.0 to 2.0.0.
Breaking
AlertViewConfig.vehicleId→identity(who is signed in on this device).configuresigns it in; call it on every sign-in and every app launch.AlertViewConfig.vehicleTypeis anAlertVehicleTypeinstead of anint, with the service's codes:car1,taxi2,bus3,coach4,truck5,motorcycle7. Bicycle, pedestrian and emergency (old7–9) are removed.AlertViewConfig.weights→weightTons(same unit, tonnes).configurethrowsPlatformException(INVALID_CONFIGURATION)with the SDK's reason when an input is rejected (nothing is applied), andPlatformException(CONFIGURE_FAILED)whenbaseUrlis nothttps://or the SDK cannot start. It no longer throwsArgumentError.setExtraHeaders/setExtraBodyFieldsreturnFuture<void>and throwPlatformException(INVALID_CONFIGURATION)on a rejected value, instead of returning the message.setSegmentUrlthrows the same way and acceptshttpsURLs only.- Error codes follow the native 2.0.0 table:
2001→2000,1003and3004are no longer used, and the2000–2999range no longer means "session expired" as a whole.
Added
logout()→Future<ResultEvent>: signs the identity out of this device.AlertViewConfig.metadata(Map<String, Object?>?), JSON-encoded in Dart and stored with the session when it opens.AlertVehicleTypeandAlertViewError(every code of the native 2.0.0 table, including the session codes2006,2007,2008,2010,3012,4001,-6,-7,-8). The names follow the native SDK, so they do not collide withmapzone_speed_alert.- Road-closed and vehicle-restricted signs in
onRestriction(closed,vehicle), drawn for the configured vehicle type by the native SDK.
Changed
- Native SDK: Android
mapzone-alert-view-android2.0.1(JitPack), iOSMapZoneAlertView2.0.1(CocoaPods). - The plugin never logs the identity or metadata.
- Example app: identity field and sign-out in the settings dialog, a
"signed in elsewhere" dialog on
2006, weight in tonnes, the six vehicle types.
1.0.0 #
Wraps the MapZone Alert View SDK 1.0.2: Android
com.github.mapzone-global:mapzone-alert-view-android:1.0.2 (JitPack) and iOS
MapZoneAlertView 1.0.2 (CocoaPods).
NavSpeedAlert.instance:configure,start,onLocation,reset,setSegmentUrl,setExtraHeaders,setExtraBodyFields,setMutedAlertTypes,setVoiceMode,setVoiceSpeed.- Streams:
onSigns(speed limit, next limit, camera, toll),onRestriction(no stopping/parking, road closed, vehicle ban, built-up area, turn restriction),onVoice,onResult,onReroute. Sign images are PNG bytes. onRestrictionandonVoiceregister their native callback only while listened to: on Android restriction images are not rendered without a listener, and the built-in voice player stays active untilonVoiceis listened to.- Calls that wait on the engine (
setExtraHeaders,setExtraBodyFields) run off the platform main thread. - Engine teardown only removes the callbacks and route that engine set up, so a background Flutter engine going away does not stop the app's alerts.