flutter_embedding_cli 0.0.1-beta.4 copy "flutter_embedding_cli: ^0.0.1-beta.4" to clipboard
flutter_embedding_cli: ^0.0.1-beta.4 copied to clipboard

This project helps generating modules for embedding flutter into a native ios, android or react-native app.

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 #

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:

  1. Builds the Flutter iOS framework with CocoaPods support
  2. Generates a ZIP file of the iOS SDK
  3. Creates Podspec files for CocoaPods integration
  4. Generates a Pod helper file
  5. If --example is 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:

  1. Builds the Flutter Android Archive (AAR)
  2. If --example is 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:

  1. Generates the React Native module structure
  2. Builds both Android AAR and iOS framework
  3. Copies Flutter artifacts to the appropriate platform directories
  4. Generates ZIP files and Podspecs for iOS
  5. Runs npm install, ci, and pack commands (packaging the module)
  6. If --example is 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 files
  • build/ios-example/ - Example iOS app (if --example flag used)

Android #

  • build/host/outputs/repo/ - Android AAR files
  • build/android-example/ - Example Android app (if --example flag used)

React Native #

  • build/flutter-rn-embedding/ - React Native module
  • build/react-native-example/ - Example React Native app (if --example flag used)

License #

MIT License

1
likes
150
points
296
downloads

Publisher

verified publisherkrispypen.be

Weekly Downloads

This project helps generating modules for embedding flutter into a native ios, android or react-native app.

Homepage
Repository (GitHub)
View/report issues

Topics

#cli #embedding-flutter #embedding-ios #embedding-android #embedding-react-native

Documentation

API reference

License

MIT (license)

Dependencies

args, mason, path, yaml

More

Packages that depend on flutter_embedding_cli