How dotcorr/dcflight works
Project type and purpose
• This is a CLI-based toolkit called “DCFlight,” under development to simplify cross-platform app development.
• It consists of:
• A Dart CLI (/cli) that will orchestrate code generation, build commands, project scaffolding
• A “template/dcflight” example app demonstrating a custom UI framework
• A set of docs and landing pages for marketing
File structure
• Top level:
• cli/: the command-line interface, with its own bin/, lib/, test/, and pubspec.yaml
• template/dcflight/: example project that uses the framework, includes:
– lib/framework: core Dart UI framework (VDOM, state, native bridge)
– ios/, android/, linux/, macos/, windows/, web/: platform embedding layers
– main.dart: entry point wiring up Dart VM → framework → native
• landing/: marketing sites (React and static HTML)
• docs/: deep-dive design docs
README for additional insights
• The CLI is not yet functional, but the example app:
• Boots a Dart VM (via Flutter engine headlessly)
• Runs a VDOM-driven UI framework based on React + Flutter concepts
• Uses a native bridge package (native_bridge/dispatcher.dart) for CRUD ops on native views
• Employs a Yoga‐based layout engine, style manager, and component registry
Main components to feature
a. CLI component
– CLI process (Dart)
– Parses commands, scaffolds projects, orchestrates builds
b. Example App / Framework component
– Dart VM (launched by Flutter Engine headless)
– VDOM layer (reconciler, component tree)
– State and hooks module
– Native bridge dispatcher / handlers
– Yoga layout manager & style manager
c. Flutter Engine (headless)
– Provides Dart runtime
– No UI surface except when canvas is needed
d. Platform Embedding
– iOS / Android / macOS / Windows / Linux runner
– Platform channel / FFI entry points
– Receives CRUD calls and renders native UI views (buttons, text, scrollviews)
e. External libraries
– Yoga for flex layout
– Dart core libs
– Native platform SDKs (UIKit, Android Views, Win32, GTK, etc.)
Relationships and interactions
• CLI → (generates) → template project
• In example app:
1. Native runner launches Flutter engine (headless) → starts Dart VM
2. main.dart calls initializeApplication() → instantiates root component
3. VDOM reconciler diffing → calls native_bridge.dispatcher to create/update native widgets
4. Native handlers → call into platform SDK to render UI
5. Layout changes → YogaShadowTree → native layout calls
6. User events on native views → propagate via bridge back to Dart event handlers
Architectural patterns and design principles
• MVU/React style (unidirectional data flow, hooks, functional components)
• VDOM diff + reconciliation
• Adapter/Bridge pattern for native UI rendering
• Modularization: core framework decoupled from platform embedding
• Parallel flutter engine for Dart VM isolation
Detail focus
• Every layer from CLI invocation down to native view instantiation
• Module boundaries (e.g., cli/lib vs. template/dcflight/lib/framework)
• Communication channels (platform channels, FFI, timers, events)