How sensie-app/flutter-sensie-plugin works
Project Type and Purpose
• This is a Flutter plugin (“plugin_sensie”) that provides a Dart API for integrating the proprietary Sensie motion-capture SDK into Flutter apps. It exposes high-level classes (SensieEngine, CalibrationSession, etc.) to Flutter via the standard Flutter plugin mechanism (platform channels).
File-Structure Analysis
• Top-level:
• lib/ – Dart public API, method-channel wiring, platform interface
• android/ – Android plugin implementation in Java + bundled AAR
• ios/ – iOS plugin implementation in Swift + embedded SensieFramework
• example/ – Sample Flutter app showing plugin usage on both Android & iOS
• test/ – Dart unit tests
• pubspec.yaml – plugin metadata and dependencies
• Patterns:
• “plugin_sensie/lib” hosts the Flutter-side API and delegates calls via MethodChannel
• “android/src” provides PluginSensiePlugin.java that registers MethodChannel handlers and calls into SensieLibrary.aar
• “ios/Classes” and Wrapper.swift forward calls into the embedded SensieFramework.framework
• example/ demonstrates a typical full-stack: Flutter UI → plugin → native SDK → sensor hardware
Key Architectural Insights from README
• SensieEngine.init, connect(), startCalibration(), captureSensie(), etc., are asynchronous Dart methods
• Under the hood these call through MethodChannel to native code
• Native code calls into vendor SDK libraries (AAR on Android, framework on iOS) which talk to sensors/bluetooth
a. Main Components
1. Flutter Application (example/) – UI, business logic
2. Dart API Layer (lib/) – SensieEngine, CalibrationSession classes
3. MethodChannel (Dart ↔ native bridge)
4. Android Plugin Module
• Java PluginSensiePlugin
• SensieLibrary.aar (compiled SDK)
5. iOS Plugin Module
• Swift PluginSensiePlugin
• SensieFramework.framework (compiled SDK)
6. Device Sensors / Bluetooth (external hardware)
b. Relationships and Interactions
• Flutter UI invokes methods on SensieEngine (Dart API)
• Dart API marshals arguments over MethodChannel
• Platform plugin receives channel calls, translates into vendor SDK calls
• Vendor SDK communicates with device sensors via Bluetooth
• Native plugin returns sensor data/results back up the channel
• Dart layer dispatches callbacks to application
c. Architectural Patterns
• Plugin Pattern: platform interface + method channels
• Asynchronous API: futures and callbacks in Dart
• Separation of concerns: UI vs. plugin vs. native SDK
d. Relevant Technologies
• Flutter & Dart
• MethodChannel (flutter/services)
• Android: Java, AAR package, Gradle
• iOS: Swift, CocoaPods, .framework
• Bluetooth / sensor APIs inside vendor SDK