navigation_safety_enums 0.1.4
navigation_safety_enums: ^0.1.4 copied to clipboard
Pure Dart navigation-safety domain enums (AlertSeverity, CircadianPhase, DriverState, DriverProfile, HapticCuePattern). No Flutter, no transitive deps.
navigation_safety_enums #
Pure Dart navigation-safety domain enums. Five stable enum
types extracted from
navigation_safety_core
for consumers who need the safety vocabulary without paying for the
larger core-package surface area or its transitive dependencies.
AlertSeverity— info / warning / critical, with declaration- order-load-bearing severity comparison via.index.CircadianPhase— 24-hour partition for circadian-aware threshold tuning, with a caution-add-only multiplier extension and acircadianPhaseFromHour(int)helper.DriverState— live driver-state axis (alert / fatigued / distracted / impairedVisibility), orthogonal to driver-trait.DriverProfile— driver-class trait axis (ageingRural/snowZoneExperienced/noviceUrban/professional/agriculturalForestry/foreignTouristSnowZone).HapticCuePattern— tactile (vibration) hazard-cue grammar for the accessibility channel (none/warning/critical). Carries the same warning set as the audio channel off the same severity gate — so a deaf / hard-of-hearing driver, or any driver inside a roaring-wind whiteout where speech cannot carry, is never silently dropped from the most serious warnings. The two announced tiers render as distinct cues (pulseCount2 vs 3) so they can be told apart by feel alone. Map fromAlertSeverityviahapticCueForSeverity(severity); the cue is a pure function of severity only.
No Flutter dependency. No transitive dependencies (beyond
test + lints for development). Safe to consume from CLI tools,
server-side logic, test fixtures, and any other pure-Dart package
that needs the safety vocabulary.
Install #
Add to pubspec.yaml:
dependencies:
navigation_safety_enums: ^0.1.0
Then import the barrel:
import 'package:navigation_safety_enums/navigation_safety_enums.dart';
Example #
import 'package:navigation_safety_enums/navigation_safety_enums.dart';
void main() {
// Severity ordering is declaration-order-load-bearing.
assert(AlertSeverity.critical.index > AlertSeverity.warning.index);
assert(AlertSeverity.warning.index > AlertSeverity.info.index);
// Map a 24-hour clock hour to a circadian phase.
final phase = circadianPhaseFromHour(DateTime.now().hour);
print('phase=${phase.name} multiplier=${phase.multiplier}');
// Driver state and driver profile are orthogonal axes.
const profile = DriverProfile.foreignTouristSnowZone;
const state = DriverState.fatigued;
print('profile=${profile.name} state=${state.name}');
}
Relationship to navigation_safety_core #
Four of the five enum source files (AlertSeverity, CircadianPhase,
DriverState, DriverProfile) are byte-identical to the corresponding
files in navigation_safety_core 0.10.0 at the time of extraction.
HapticCuePattern was added later (0.1.3) and has no counterpart in that
0.10.0 baseline. A subsequent navigation_safety_core 0.11.0 release
will depend-on and re-export from this package for ABI-compat, so
existing consumers of navigation_safety_core will not need to
change imports.
This package is intended for two cohorts who consume the enum vocabulary directly:
- open-source-consumers — pure-Dart packages and CLI tools that need the vocabulary without the larger core-package surface area.
- parallel-product-builders — integrators building independent
navigation or driver-assist products who want a stable shared
vocabulary without coupling their dependency tree to the full
navigation_safety_coreevolution.
Caveats — UNVERIFIED magnitudes #
The numeric multiplier values on CircadianPhase are
design-default hypotheses pending field-measurement validation.
See the in-source documentation and navigation_safety_core's
KNOWN_LIMITATIONS.md for the UNVERIFIED-magnitude flag.
The state-axis adjustment magnitudes documented on DriverState
values are similarly UNVERIFIED at this spike. Both axes carry the
caution-add-only invariant — values may make thresholds warn
earlier than baseline but never later.
License #
BSD-3-Clause. See LICENSE.