Open-source Flutter client for MeshCore LoRa mesh networking devices.
# Install dependencies
~/flutter/bin/flutter pub get
# Run in debug mode
~/flutter/bin/flutter run
# Build Android APK
~/flutter/bin/flutter build apk
# Build iOS
~/flutter/bin/flutter build ios
# Run static analysis
~/flutter/bin/flutter analyze
# Run tests
~/flutter/bin/flutter testlib/
├── main.dart # App entry point, MaterialApp setup with Provider
├── connector/
│ └── meshcore_connector.dart # BLE communication layer (MeshCoreConnector)
├── screens/
│ ├── scanner_screen.dart # BLE device scanning (home screen)
│ ├── device_screen.dart # Connected device hub with navigation
│ ├── chat_screen.dart # Chat interface (placeholder)
│ ├── contacts_screen.dart # Contacts list (placeholder)
│ └── settings_screen.dart # Device info and app settings
└── widgets/
└── device_tile.dart # Device list item with signal strength
- Provider with
ChangeNotifierpattern MeshCoreConnectoris the central state holder for BLE connection- Screens use
Consumer<MeshCoreConnector>for reactive UI updates
- Material 3 design (
useMaterial3: true) - System-based dark/light mode (
ThemeMode.system) - Blue color scheme seed
- Service UUID:
6e400001-b5a3-f393-e0a9-e50e24dcca9e - RX Characteristic:
6e400002-b5a3-f393-e0a9-e50e24dcca9e(Write to device) - TX Characteristic:
6e400003-b5a3-f393-e0a9-e50e24dcca9e(Notify from device)
- Scans for devices with name prefix
MeshCore- - Filters by
platformNameoradvertisementData.advName
enum MeshCoreConnectionState {
disconnected,
scanning,
connecting,
connected,
disconnecting,
}- Send:
MeshCoreConnector.sendFrame(Uint8List data) - Receive:
MeshCoreConnector.receivedFramesstream ofUint8List
| Package | Version | Purpose |
|---|---|---|
| flutter_blue_plus | ^2.1.0 | BLE communication |
| provider | ^6.1.5+1 | State management |
| cupertino_icons | ^1.0.8 | iOS-style icons |
BLUETOOTH,BLUETOOTH_ADMIN(API 30 and below)BLUETOOTH_SCAN,BLUETOOTH_CONNECT,BLUETOOTH_ADVERTISE(API 31+)ACCESS_FINE_LOCATION,ACCESS_COARSE_LOCATION(for BLE scanning)
NSBluetoothAlwaysUsageDescriptionNSBluetoothPeripheralUsageDescription
- Minimal: Only write code that is necessary. Avoid over-engineering.
- Organized: Keep related code together. One responsibility per file.
- Maintainable: Favor readability over cleverness. Simple is better.
- Use
StatelessWidgetwithConsumerfor state-dependent UI - Use
constconstructors where possible - Prefix private methods/fields with
_ - Center app bar titles (
centerTitle: true) - Material widgets only - no Cupertino or custom widgets
- Handle disconnection gracefully (auto-navigate back to scanner)
- Premature abstractions - don't create helpers until needed in 3+ places
- Unnecessary comments - code should be self-explanatory
- Feature flags or backwards-compatibility shims
- Over-engineered error handling for impossible scenarios
| File | Purpose |
|---|---|
lib/connector/meshcore_connector.dart |
All BLE logic - scanning, connecting, data transfer |
lib/screens/scanner_screen.dart |
Entry point UI, device list |
lib/main.dart |
App configuration, theme, Provider setup |
pubspec.yaml |
Dependencies and project metadata |
The following screens are implemented as placeholders and need full implementation:
chat_screen.dart- Mesh chat functionalitycontacts_screen.dart- Contact managementsettings_screen.dart- Radio settings, node identity, location (partially implemented)