-
Core repo artifacts:
flutter_battery/(current root) — plugin supplyingFlutterBattery,BatteryInfo,BatteryAnimation.app/— Flutter IoT shell driven byapp_shell.dartwith NavigationBar tabs (设备/仪表盘/电量曲线/设置).android-iot-native/— Kotlin library skeleton emitting telemetry/connection/device events via shared flow.integration/channel/contracts/channel_contract.yaml— Method/Event channel contract (iot/native,iot/stream).scripts/bootstrap_iot.sh— helper for recreating directory scaffold.
-
App structure highlights:
app/lib/app_shell.dart: root MaterialApp that buffersNativeBridge.eventsand routes to feature tabs.app/lib/core/native_bridge.dart: singleton bridge exposingeventsstream plusscan/connect/startTelemetry/requestBatterySnapshotwrappers aligned with channel contract.app/lib/features/device/device_page.dart: renders discovery events, connect + telemetry toggles using callbacks fromapp_shell.app/lib/features/dashboard/dashboard_page.dart: consumes buffered events + current battery level to driveBatteryAnimation, telemetry cards, and trend placeholder.app/lib/features/settings/settings_page.dart: shows battery status, runtime toggles, and re-scan actions within the tab layout.app/lib/shared/widgets/{gauge.dart,line_chart.dart}: placeholder widgets for charts.
-
Plugin linkage:
app/pubspec.yamldepends onflutter_batteryviapath: ../flutter_battery.- Dashboard imports
package:flutter_battery/flutter_battery.dartand shared animation.
-
Outstanding work / reminders:
- Local Flutter/Dart CLI uses CRLF shebang; running
flutter pub get/flutter runcurrently fails (/usr/bin/env: 'bash\r'). Need environment with proper SDK (or fix scripts) before building. - Android runner still needs channel wiring to new
android-iot-nativemodule for full functionality. - Tests not run; once SDK available, execute
flutter pub getinsideapp/andflutter test.
- Local Flutter/Dart CLI uses CRLF shebang; running
Use this file as a continuity note for future sessions.