Flutter‑boot: Engineering Hybrid Flutter Modules for Mobile Development
Flutter‑boot is an open‑source CLI that streamlines hybrid Flutter module development by providing a standardized project layout and automated commands—create, link, remotelink, and update—to integrate Flutter into existing iOS/Android apps, enable local and cloud builds, and cut setup to a single command and two lines of code.
More companies are exploring Flutter. There are two main development modes: a standalone Flutter app where the native project is embedded, and a Flutter module that is integrated into existing iOS and Android native apps. In the module mode the native project can reside anywhere, but its local Flutter path must be declared.
flutter‑boot addresses two key challenges of hybrid development: engineering design and the hybrid stack. It provides a standard project structure and interactive commands, giving developers both Flutter and native views and supporting local Flutter development as well as cloud‑based Flutter builds.
The tool automatically injects the hybrid‑stack dependencies into the native project and, after inserting a few template lines, the mixed stack works out‑of‑the‑box.
Open‑source repository: https://github.com/alibaba-flutter/flutter-boot
To understand flutter‑boot’s engineering design, one should first be familiar with Google’s “Add Flutter to existing apps” module structure. The typical layout looks like:
some/path/ my_flutter/ lib/main.dart .ios/ .android/In this structure, .ios and .android are template projects used to launch the app. The Flutter framework is declared as a dependency, native plugins are integrated as source code, and Dart plugins become active only when referenced by business code, requiring build‑mode‑aware handling.
The official hybrid project has several drawbacks: manual file/configuration addition, no support for running native projects under the Flutter repository, and no remote‑machine build capability.
flutter‑boot solves these issues through four processes—create, link, remotelink, and update—plus an init command that bundles the essential steps into an interactive CLI.
Key steps:
create : scaffolds a Flutter module, performs checks, and prepares a Git repository.
link : associates the local native project with the Flutter module, automates integration, and creates soft links to the iOS/Android directories.
remotelink : records remote Flutter repository information for remote builds.
update : pulls Flutter code on remote machines and sets up the build environment.
The hybrid stack, open‑sourced by Xianyu, coordinates native and Flutter page interactions. It faces two main issues: version compatibility (current stack 0.1.52 supports Flutter 1.5.4) and packaging of demo code.
Demo code is divided into four parts: engine hosting, route configuration, Dart demo pages, and native test entry points. A single line of code added to the app’s initialization handles engine hosting; route configuration is added to both native and Flutter sides; demo Dart pages are generated and integrated; and a test button is provided for quick verification.
Using flutter‑boot, developers can set up a hybrid project with one command and two lines of code, dramatically reducing setup time and cost.
Xianyu Technology
Official account of the Xianyu technology team
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.