Gesture flashlight for Android. Double-chop your wrist, torch turns on. Chop again, torch turns off.
Built by Preston Winters at Winters Code.
Status: code complete, pending Play Store launch.
A flashlight you trigger by gesture, not by tapping a screen.
Two sharp wrist movements (a "double chop") toggle the camera torch. Works with the screen off, the phone in your pocket, or your hands full. Runs as a foreground service so accelerometer sampling continues with the screen locked.
Designed for: walking the dog at night, finding the keyhole in the dark, hands full of groceries, getting up at 2am.
- Accelerometer sampling. Sensors-plus stream at 20ms (or 50ms in battery saver mode).
- Peak detection. A chop is a sharp spike above the calibration threshold (default: 80% of average peak from 5-chop calibration).
- Pattern matching. Two peaks within 600ms = double chop. Three peaks within 900ms = SOS trigger (premium).
- Action dispatch. Camera torch toggle via
torch_light, or SOS pattern loop via the same.
The state model is a singleton with stream-based detection. The foreground service keeps the isolate alive when the screen is off.
lib/
├── main.dart # Entry point + onboarding gate
├── theme.dart # OLED black, amber accent
├── state/
│ └── chop_light_state.dart # Singleton state + sensor stream
├── services/
│ ├── chop_light_functions.dart # SharedPreferences, RevenueCat init
│ └── chop_light_actions.dart # All user-triggered actions
├── screens/
│ ├── onboarding_screen.dart # 5-chop calibration on first run
│ ├── home_screen.dart # One big circle. Glow = on.
│ └── settings_screen.dart # All toggles + premium gate
└── widgets/
├── torch_circle.dart # The home circle widget
└── upgrade_sheet.dart # RevenueCat purchase sheet
About 3,200 lines of Dart. Single feature, well-factored.
- Flutter 3.16+ / Dart 3.2+
- sensors_plus for accelerometer streams
- torch_light for camera torch control
- flutter_foreground_task for background detection (Android specialUse FGS)
- purchases_flutter (RevenueCat) for the freemium gate
- shared_preferences for state persistence
- vibration + battery_plus for haptics and battery guard
No backend. All processing on-device. No network calls except RevenueCat.
Free tier: double-chop toggle, calibration, pocket lock, demo mode, battery saver, chop counter.
Premium ($0.99/mo with 7-day trial, or $4.99 lifetime): SOS pattern, auto-off timer, battery guard, screen flash mode, sensitivity slider, gesture test.
See CHOPLIGHT_FEATURE_SPEC.md for the full locked spec.
This repo is the source. To build:
flutter pub get- Configure Android manifest permissions (see
CHOPLIGHT_DEPLOY_GUIDE.md) - Replace
goog_YOUR_REVENUECAT_KEYinlib/services/chop_light_functions.dartwith your real key flutter build appbundle --release
The deploy guide walks through the full Play Store submission process, including the foreground-service-specialUse declaration which Google requires explicit justification for.
MIT. See LICENSE.
winterscode.com | preston@winterscode.com
Part of Winters Code, a solo software shop in Bandon, Oregon.