ImpactConfig class

Crash & fall detection.

When enableCrashDetection is true, a corroborated high-g impact while moving raises a potential_crash (with a confirmWindowMs cancel countdown) that auto-confirms to crash unless cancelled — delivered via Tracelet.onImpact. enableFallDetection adds best-effort personal-fall detection (more false positives; default off).

Default: disabled. Tracelet provides the trigger + cancel window; it never places emergency calls.

Annotations

Constructors

ImpactConfig({bool? enableCrashDetection, bool? enableFallDetection, double? crashGThreshold, double? crashMinSpeedKmh, double? fallGThreshold, int? confirmWindowMs, double? minImpactConfidence, String? crashModelUrl, String? crashModelSha256, double? crashModelThreshold, String? crashModelUnlockUrl, String? crashModelLicenseKey})
Creates a new ImpactConfig.
const
ImpactConfig.fromMap(Map<String, Object?> map)
Creates an ImpactConfig from a map.
factory

Properties

confirmWindowMs int
Countdown (ms) before a candidate auto-confirms. Default 15000.
no setter
crashGThreshold double
Impact magnitude (g) for a crash candidate. Default 2.0 (lowered from 3.0 after a field-data study found 3.0 g missed ~half of real crashes; the cancel-countdown offsets the extra false alarms).
no setter
crashMinSpeedKmh double
Pre-impact speed (km/h) required to corroborate a crash. Default 25.
no setter
crashModelLicenseKey String?
Customer license key presented to crashModelUnlockUrl. Bound to your app (package/bundle id) and signed by you; never grants access on its own — the endpoint validates it before returning the key.
final
crashModelSha256 String?
Optional SHA-256 (hex) of the encrypted model blob for integrity verification after download. Recommended whenever crashModelUrl is set.
final
crashModelThreshold double
Probability threshold (0..1) at which the ML model flags a crash. Default 0.5. Use the rf_probability_threshold from the model's training report.
no setter
crashModelUnlockUrl String?
Optional licensing unlock endpoint (e.g. a Cloudflare Worker). When set with crashModelLicenseKey, the SDK POSTs the license to this URL to fetch the decryption key + model URL at runtime, instead of the host injecting the key manually. The key is held in memory only. null ⇒ no auto-unlock.
final
crashModelUrl String?
Optional URL of an AES-256-GCM encrypted crash ML model (the portable random-forest JSON). When set (and crash detection is enabled), the SDK downloads it once, verifies crashModelSha256, decrypts and runs it to score impacts; it falls back to the rule engine if absent/offline. The model is opt-in and downloaded — never embedded — so the base SDK size is unchanged. null ⇒ pure rule engine (default). The decryption key is supplied by the host at build/run time, never via this config.
final
enableCrashDetection bool
Master switch for vehicle crash detection.
no setter
enableFallDetection bool
Personal fall detection (best-effort; default false).
no setter
fallGThreshold double
Impact magnitude (g) for a fall candidate. Default 2.5.
no setter
hashCode int
The hash code for this object.
no setteroverride
minImpactConfidence double
Suppress candidates below this confidence. Default 0.6.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

mergedWith(ImpactConfig other) ImpactConfig
Applies every field other explicitly supplied on top of this config, leaving fields other left unset as they are here.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolved() ImpactConfig
Returns this config with every field pinned to its effective value.
toMap() Map<String, Object?>
Serializes to a map.
toString() String
A string representation of this object.
inherited
toTlConfig() → TlImpactConfig
Converts to Pigeon TlImpactConfig.

Operators

operator ==(Object other) bool
The equality operator.
override