navigation_safety_core 0.3.0 copy "navigation_safety_core: ^0.3.0" to clipboard
navigation_safety_core: ^0.3.0 copied to clipboard

Pure Dart core models for navigation safety: alert severity, safety score, threshold config, navigation route, and safety scenario identifiers. No Flutter dependency. Consumed by navigation_safety (th [...]

navigation_safety_core #

pub package CI License: BSD-3-Clause

Pure Dart core models for driving-navigation safety.

SafetyScore, AlertSeverity, NavigationRoute, SafetyScenario, NavigationSafetyConfig — the type vocabulary that navigation_safety wraps with Flutter BLoCs and widgets.

This package exists so that non-Flutter consumers — CLI tools, server-side logic, test fixtures, pure-Dart packages like driving_conditions — can depend on the safety vocabulary without inheriting Flutter + flutter_bloc.

If you're building a Flutter app and want the BLoC layer too, depend on navigation_safety instead; it re-exports everything here for back-compatibility.

What's in here #

  • SafetyScore — composite score across road-surface, visibility, hazard-density, and route-condition axes.
  • AlertSeverityinfo / warning / critical. Declaration order is load-bearing (callers compare .index to enforce monotonic alert upgrades; lower severity never replaces higher).
  • NavigationRoute — typed route representation independent of any specific routing engine.
  • SafetyScenario — enumeration of driving-condition scenarios (clear / wet / icy / heavy-snow / etc.) used by the score computation.
  • NavigationSafetyConfig — knobs for safety-overlay behavior (alert thresholds, dismissibility, severity caps).

Pure Dart, no native dependencies, no Flutter.

Install #

dependencies:
  navigation_safety_core: ^0.1.0

Use #

import 'package:navigation_safety_core/navigation_safety_core.dart';

void main() {
  const config = NavigationSafetyConfig();
  final scenario = SafetyScenario.heavySnow;
  final score = SafetyScore.forScenario(scenario, config: config);

  if (score.severity.index >= AlertSeverity.warning.index) {
    print('Alert: ${score.severity.name} — ${score.advisoryMessage}');
  }
}

License #

BSD-3-Clause. See LICENSE.

0
likes
0
points
462
downloads

Publisher

unverified uploader

Weekly Downloads

Pure Dart core models for navigation safety: alert severity, safety score, threshold config, navigation route, and safety scenario identifiers. No Flutter dependency. Consumed by navigation_safety (the full Flutter + BLoC package) and any other pure-Dart consumer that needs the safety vocabulary without paying for the Flutter rendering surface.

Repository (GitHub)
View/report issues

Topics

#navigation #safety #automotive #winter-driving

License

unknown (license)

Dependencies

equatable, latlong2

More

Packages that depend on navigation_safety_core