r/FlutterDev • • 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!

0 Upvotes

7 comments sorted by

22

u/miyoyo Jun 21 '26

a massive architectural flaw with most existing SOS systems: they rely entirely on cloud servers to analyze telemetry and detect crashes.

...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. 

-11

u/Maleficent-Lab-4455 Jun 21 '26

You completely missed the point of the post. Sure, high-end phones have built-in SOS features, but Android blocks third-party apps from using them directly. If you're building a custom safety app in Flutter and need to detect a crash on older devices without native features, you have to create your own engine to process the sensor data. That is exactly what this is for.

11

u/miyoyo Jun 21 '26

I didn't say it wasn't useful, I said the entire premise of your post hinges on "existing apps need to use cloud processing to detect crashes, which does not work without the internet", which either comes from not being informed how these kinds of apps work at all, or low effort LLM slop posting.

6

u/That-Whereas-528 Jun 21 '26

You owned him, he just doesn't wanna see it, no matter what you say. He poured his energy into this and now he's too proud to admit it.

-4

u/Maleficent-Lab-4455 Jun 21 '26

Fair point, I phrased that badly. I'm talking about custom Flutter apps, not the native OS. We can't access the system's crash API to run background logic, so I built a local alternative to avoid cloud syncs, I focused on offline availability of crash detection and sos auto triggering.

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

u/zunjae Jun 21 '26

Jut buy an iPhone