flutter_nerve 0.2.0
flutter_nerve: ^0.2.0 copied to clipboard
A sensory-reactive UI engine for Flutter. Make your app feel the real world — react to battery, network, motion, light, and sound.
Changelog #
All notable changes to flutter_nerve will be documented in this file.
This project adheres to Semantic Versioning.
0.2.0 — 2026-03-12 #
Added #
NerveMonitor— floating, draggable debug overlay showing all live sensor readings with mini gauges. Tap to collapse to a 🧠 icon.NerveShake— detects shake gestures via accelerometer magnitude spikes; firesonShakecallback with configurable threshold & cooldown.NerveSpring— physics-spring offset animation driven by tiltX/tiltY, creating a natural floating/parallax effect.NerveConnectivity— pre-built animated banner that slides in when network ispoorornone; fully customizable.NerveFakes— testing utilities (withBattery,withNetwork,withMotion,withLight,withSound,withAllSenses) for easytestWidgetswithout real hardware.
0.1.0 — 2025-03-11 #
Added #
NervePulse— widget that pulses (scales + optional opacity) in sync with ambient sound level.NerveGlow— widget with an animated glowing border driven by tilt magnitude or a custom mapper.NerveBatteryIcon— custom-painted animated battery indicator (color-coded, charging bolt overlay).NerveController.withMicrophone()— async factory that initialises microphone permission & stream in one call.NerveRoot.enableMicrophoneflag — passenableMicrophone: trueto haveNerveRootmanage mic init automatically; no asyncmain()required.
Fixed #
- Default
SoundSense()was a silent stub; example app now uses the real microphone viaenableMicrophone: true.
Initial release 🎉
Added #
Core
NerveState— immutable snapshot of all sensor readings (battery, charging, network quality, tilt X/Y, ambient light, sound level).NerveController— aggregates all sense streams into a single reactiveChangeNotifier. Accepts injected adapters for easy testing.NerveProvider—InheritedNotifier<NerveController>that feeds the widget tree; exposesNerveProvider.of(context)andNerveProvider.controllerOf(context).NerveRoot— convenienceStatefulWidgetthat owns and initialises aNerveControllerautomatically.
Sense Adapters
BatterySense— pollsbattery_pluson a configurable interval and emits(level 0.0–1.0, isCharging)pairs.NetworkSense— wrapsconnectivity_plus, mappingConnectivityResultvalues to a four-tierNetworkQualityenum (none | poor | fair | good).MotionSense— wrapssensors_plusaccelerometer events; normalises raw m/s² to -1.0..1.0 tilt values. IncludesMotionSense.magnitude()helper.LightSense— wraps thelightpackage to emit ambient lux readings.SoundSense— usesrecordpackage to sample audio amplitude at a configurable rate and normalize it to 0.0–1.0.
Reactive Widgets
NerveBuilder— rebuilds its subtree on everyNerveStatechange, analogous toAnimatedBuilder.ReactiveContainer— animated container whose color, scale, and blur react to sensor data via mapper callbacks.NerveScaffold— full-screen scaffold with configurable background gradient, adaptive status-bar style, and optional motion-parallax header.
Adaptive Theme
NerveTheme— derivesThemeDatafrom the currentNerveState(e.g. dims the palette when battery is low, darkens when ambient light is low).