How ejaraapp/trustdart works
Project type and purpose
• This is a Flutter “plugin” package (trustdart) that provides a Dart API for local wallet operations (key management, address derivation, transaction signing) by bridging into the TrustWallet Core native library via method channels. It does not provide on-chain querying or broadcast functionality.
File structure
• Top-level directories:
• android/ – Kotlin plugin code, Gradle config
• ios/ – Swift/Objective-C plugin code, CocoaPods spec
• lib/ – Dart side of the plugin (trustdart.dart)
• example/ – A sample Flutter app showing usage on Android/iOS
• .github/ – CI workflows for code scanning
• Plugin entrypoint (TrustdartPlugin.kt, SwiftTrustdartPlugin.swift)
• WalletHandler, Coin classes per blockchain
• Interfaces (protocols) and utility classes
README for additional insights
• Confirms focus on local operations only
• Uses Flutter method channels to call into the native layer
• Roadmap mentions adding more coins and Bitcoin signing
a. Main components
• Consumer: Example Flutter app (UI layer)
• Dart plugin API: lib/trustdart.dart
• Platform channel (MethodChannel)
• Android native plugin module
• iOS native plugin module
• Underlying TrustWallet Core (C++/prebuilt library)
• CI/CD: GitHub Actions, Sonar scan (optional external)
b. Relationships and interactions
1. App UI calls Dart API
2. Dart API invokes MethodChannel
3. MethodChannel routes call to native plugin on each platform
4. Native plugin (WalletHandler → Coin modules → Core) executes cryptographic operations
5. Native returns result via MethodChannel back to Dart
c. Architectural patterns/design principles
• Platform Channels for cross-language boundary
• Plugin modularization by coin (extensibility)
• Clear separation of concerns: UI vs. API vs. native implementation
d. Key technologies/frameworks
• Flutter & Dart
• Android: Kotlin, Gradle, TrustWallet Core .aar
• iOS: Swift/ObjC, CocoaPods, TrustWallet Core .framework
• GitHub Actions / Sonar