Create Flutter Package

Create new Flutter package inside application or monorepo workspace.
xflutter_cli create --template=package

Create Package inside Workspace

  • Make sure to run the command in the workspace root directory.
If you created a package manually (without CLI), make sure to declare the package manually in xflutter_cli.yaml file.
Generating package though CLI will add automatically the package to xflutter_cli.yaml file, and make it visible to CLI when you run a command.

Result:

  • xflutter_cli_test_application
    • android
    • assets
    • ios
    • lib
      • main.dart
    • packages
      • products
        • lib
          • src
            • .gitkeep
          • products.dart
        • pubspec.yaml
    • analysis_options.yaml
    • build.yaml
    • flutter_launcher_icons.yaml
    • flutter_native_splash.yaml
    • pubspec.yaml
    • xflutter_cli.yaml

Usage:

Name
Type
Description
Allowed Values
Format
nameoptionpackage name-snack case
architectureoptionspecify package architecturelayers, modules