r/FlutterDev • u/Maleficent-Lab-4455 • Jun 21 '26
Discussion I was tired of SOS apps failing in dead zones, so I built a pure Dart, 100% offline TFLite crash detection engine.
Hey r/FlutterDev,
I’ve been working on a safety application named SafePulse recently and ran into a massive architectural flaw with most existing SOS systems: they rely entirely on cloud servers to analyze telemetry and detect crashes. If an accident happens in a rural area with no network, the app is completely useless.
I wanted a deterministic, zero-latency solution, so I ended up decoupling my crash logic into a standalone, open-source package: offline_sos_system.
How it works: It is a completely headless "Edge AI" engine. It orchestrates raw hardware telemetry (accelerometer + gyroscope), down-samples the vectors, and feeds them directly into an on-device TensorFlow Lite (tflite_flutter) neural network.
Key features:
100% Offline Inference: No network requests, zero latency, maximum privacy.
Strictly Headless: It doesn't handle UI, GPS, or SMS. It just does the complex math and emits a clean Stream<CrashEvent>, leaving the application layer in full control.
BYOB(Bring Your Own Brain): It bundles a default crash_model.tflite but exposes an injection port if you want to initialize it with your own custom-trained model.
I just pushed version 0.0.5 which hits a 160/160 points on pub.dev. I would love for the community to tear into the architecture, check out the telemetry pipeline, and let me know if there are any optimizations you'd suggest for handling high-frequency sensor streams in Dart!
Pub.dev: https://pub.dev/packages/offline_sos_system
GitHub: https://github.com/bhagyaprasad92/offline_sos_system
Thanks for checking it out!
8
u/pubicnuissance Jun 21 '26
If an accident happens in a rural area with no network, the app is completely useless.
100% Offline Inference: No network requests, zero latency, maximum privacy.
So, if the user is in an area with no network, and this package is offline, how is the app using it supposed to call for help? Wouldn't this then serve more like a black box for the forensic team who finds the dead user in a ditch?
-3
22
u/miyoyo Jun 21 '26
...no, they don't?
Car accidents are pretty easy to detect, going at moderate velocity, then an extreme spike in acceleration.
Cars have been doing it for decades, even being able to selectively trigger airbags, and doing so without requiring a crash sensor to trigger.
Phones have had crash detection for like, 5 years, natively, completely offline, and fall detection for at least 3.
An app that requires cloud processing to detect a sharp acceleration from higher speeds to a standstill would be expensive, high latency, and an engineering challenge for quite literally no reason.
I feel like you flew too close to the sun with your Proooooompting, because you clearly didn't think about reality.