3.9 KiB
3.9 KiB
Technology Stack
Analysis Date: 2026-04-16
Languages
Primary:
- Dart >=3.4.3 - Flutter plugin Dart-side code (
lib/,test/) - Java 8 - Android native plugin implementation (
android/src/main/java/)
Secondary:
- Kotlin 1.7.10 - Declared in example app Gradle plugins (
example/android/settings.gradle) but not actively used in plugin code
Runtime
Environment:
- Flutter >=3.3.0
- Android SDK - compileSdk 34, minSdk 21
Package Manager:
- pub (Dart) - Lockfile:
pubspec.lockpresent - Gradle 7.3.0 - Android build system
Frameworks
Core:
- Flutter >=3.3.0 - Cross-platform plugin framework
- Flutter Plugin API -
FlutterPlugin,MethodCallHandler,MethodChannel,EventChannel
Testing:
- flutter_test (Flutter SDK) - Unit testing framework
- JUnit 4.13.2 - Android native unit testing
- Mockito 5.0.0 - Java mocking for Android tests
- integration_test (Flutter SDK) - Integration testing
Build/Dev:
- flutter_lints ^3.0.0 - Lint rules
- Gradle 7.3.0 - Android build automation
Key Dependencies
Critical:
- plugin_platform_interface ^2.0.2 - Federated plugin platform interface pattern (
Ch34PlatformextendsPlatformInterface) - CH34XUARTDriver (local JAR, 140KB) - WCH official UART library, located at
android/libs/CH34XUARTDriver.jar. ProvidesWCHUARTManager,ChipType2,IDataCallback,IModemStatus,GPIO_Statusetc.
Infrastructure:
- cupertino_icons ^1.0.6 - Example app only, Material/Cupertino icon support
Android Native Dependencies (WCH SDK):
cn.wch.uartlib.WCHUARTManager- Core manager singletoncn.wch.uartlib.chipImpl.type.ChipType2- Chip type identificationcn.wch.uartlib.callback.IDataCallback- Serial data callback interfacecn.wch.uartlib.callback.IModemStatus- Modem status callback interfacecn.wch.uartlib.callback.IUsbStateChange- USB state change callbackcn.wch.uartlib.exception.*- Exception classes (ChipException, NoPermissionException, UartLibException)
Configuration
Environment:
analysis_options.yaml- Includespackage:flutter_lints/flutter.yaml- No
.envor environment variable configuration required - Secrets stored in example
local.properties(flutter.sdk path)
Build:
pubspec.yaml- Main plugin manifest, package:ch34, version1.0.0pubspec.lock- Dependency lockfileandroid/build.gradle- Android library build config (namespace:com.example.ch34)android/settings.gradle- Project name:ch34example/android/build.gradle- Example app root buildexample/android/app/build.gradle- Example app module (namespace:com.example.ch34_example)example/android/settings.gradle- Gradle plugins including dev.flutter.flutter-plugin-loader
Platform Requirements
Development:
- Flutter SDK >=3.3.0
- Dart SDK >=3.4.3
- Android SDK compileSdk 34
- Java 8+ (sourceCompatibility/targetCompatibility = JavaVersion.VERSION_1_8)
Production:
- Android device with USB Host support (
android.hardware.usb.hostfeature declared inandroid/src/main/AndroidManifest.xml) - Android minSdk 21 (Android 5.0 Lollipop)
- Physical CH34X series USB-to-serial hardware connected via USB OTG
Supported Chip Models
CH340, CH341, CH342, CH343, CH344, CH347, CH9101, CH9102, CH9103, CH9104, CH9143
Build System
Flutter Plugin: Standard Flutter plugin structure with Android platform implementation.
Communication Pattern:
MethodChannel('ch34')- 33 method calls for device controlEventChannel('ch34/data')- Serial data streamingEventChannel('ch34/modem')- Modem status streamingEventChannel('ch34/usb_state')- USB plug/unplug events
Architecture Pattern: Federated plugin with platform interface (Ch34Platform), method channel implementation (MethodChannelCh34), and manager facade (Ch34Manager).
Stack analysis: 2026-04-16