Flutter Embedding CLI
A command-line tool for generating modules that allow embedding Flutter into native iOS, Android, or React Native (more to come later) applications.
Screenshot

Overview
This CLI tool helps developers create the module and example applications for integrating Flutter modules into existing native mobile applications. At the moment it supports three platforms: iOS, Android, and React Native.
Installation
Add this to your package's pubspec.yaml file:
dependencies:
flutter_embedding: ^0.0.1-beta.2
dev_dependencies:
flutter_embedding_cli: ^0.0.1-beta.2
Usage
The CLI provides a single command with multiple subcommands:
dart run flutter_embedding_cli:generate [options] <command> [arguments]
Commands
iOS Module Generation
Generate iOS Flutter module and optionally create an example app:
dart run flutter_embedding_cli:generate ios [--example]
Options:
--example,-e: Generate an example iOS app alongside the module
What it does:
- Builds the Flutter iOS framework with CocoaPods support
- Generates a ZIP file of the iOS SDK
- Creates Podspec files for CocoaPods integration
- Generates a Pod helper file
- If
--exampleis specified, creates a complete example iOS app
Android Module Generation
Generate Android Flutter module and optionally create an example app:
dart run flutter_embedding_cli:generate android [--example]
Options:
--example,-e: Generate an example Android app alongside the module
What it does:
- Builds the Flutter Android Archive (AAR)
- If
--exampleis specified, creates a complete example Android app
React Native Module Generation
Generate React Native Flutter module and optionally create an example app:
dart run flutter_embedding_cli:generate react-native [--example]
Options:
--example,-e: Generate an example React Native app alongside the module
What it does:
- Generates the React Native module structure
- Builds both Android AAR and iOS framework
- Copies Flutter artifacts to the appropriate platform directories
- Generates ZIP files and Podspecs for iOS
- Runs npm install, ci, and pack commands (packaging the module)
- If
--exampleis specified, creates a complete example React Native app
Configuration
pubspec.yaml Requirements
Your Flutter module's pubspec.yaml must include the following configuration:
flutter:
module:
androidPackage: com.yourcompany.yourapp
iosBundleIdentifier: com.yourcompany.yourapp
Output Structure
iOS
build/ios/sdk/- iOS framework and CocoaPods filesbuild/ios-example/- Example iOS app (if--exampleflag used)
Android
build/host/outputs/repo/- Android AAR filesbuild/android-example/- Example Android app (if--exampleflag used)
React Native
build/flutter-rn-embedding/- React Native modulebuild/react-native-example/- Example React Native app (if--exampleflag used)
License
MIT License