Search the site
GETTING STARTED
Add --brownfield to dartvel build to get what a native app embeds: an Android library, or XCFrameworks for iOS and macOS.
It extends Flutter's add-to-app, so the host starts the project the way it would start any Flutter module.
ON THIS PAGE
Build the artifact a host embeds
Start the project from the host
Adopt an existing Flutter application
Planned host integration
dartvel build android --brownfield
dartvel build ios --brownfield
dartvel build macos --brownfieldCopy code to clipboard
Each command generates the client, then builds the project as a Flutter module in build/brownfield and leaves the result in build/brownfield/<target>: a Maven repository for Android, XCFrameworks for iOS and macOS. Your project is not changed.
Next to the artifact, HOST.md says how the host adds it and which entry point to start.
iOS and macOS frameworks are built with Xcode, so those two commands need a Mac, or --cloud.
Add --debug or --profile for another build mode. Release is the default.
Every project gets an entry point named dartvelEmbeddedEntry_<package>. Start an engine there, or start main, which runs the same entry. The project boots as an embedded entry: no single-instance lock and no window of its own, because the host owns the process.
On Android, start several projects from one FlutterEngineGroup so each extra engine costs a few megabytes. On iOS and macOS, call run(withEntrypoint:) on a FlutterEngine.
dartvel init
dartvel devCopy code to clipboard
init adds Dartvel to a Flutter project, and dartvel dev generates the client. Keep its router or adopt file-based pages. A Dartvel application can also mount another Dartvel application with dartvel add.
dartvel add ../checkoutCopy code to clipboard
Not yet implemented
Brownfield builds for the web (a script and an element the host page places), Linux and Windows. The CLI refuses those targets with the reason instead of building an app a host cannot embed.
A generated, typed host API: mount and unmount routes, and messages both ways.
Host back navigation, lifecycle and verified session hand-off.
Several projects in one module (--integrated), and projects on different versions side by side.
The Brownfield section in NEW_SPEC.md records the full design and the order it is built in.
FSL-1.1-MIT licensed. Built with Dartvel.
Dartvel is made by
To the bottom