Skip to content

flutter_asset Free

A Mason brick for generating type-safe asset packages with pure Dart contracts (asset_core) and Flutter asset enums with real SVG icons and Lottie animations.

Version: 1.0.0

Variables

VariableTypeDefaultDescription
appNamestringMyAppApplication name for package naming
prefixstringAppPrefix for asset class names
isForMonorepobooleantrueWhether this package will be part of a monorepo structure
includeGeneratedbooleanfalseWhether to include generated files in version control

Usage

Interactive

bash
archipelago generate flutter_asset

Non-interactive (CI)

bash
archipelago generate flutter_asset --config my_config.json

Config Template

json
{
  "@appName": "Application name for package naming",
  "appName": "MyApp",
  "@prefix": "Prefix for asset class names",
  "prefix": "App",
  "@isForMonorepo": "Whether this package will be part of a monorepo structure",
  "isForMonorepo": true,
  "@includeGenerated": "Whether to include generated files in version control",
  "includeGenerated": false
}

Generated Structure

packages/
├── asset_core/
│   ├── lib/
│   │   ├── asset_core.dart                # Barrel file
│   │   └── src/
│   │       ├── {prefix}_asset.dart
│   │       ├── {prefix}_asset_category.dart
│   │       ├── {prefix}_asset_data.dart
│   │       ├── {prefix}_asset_type.dart
│   │       └── contracts/
│   │           ├── contracts.dart
│   │           ├── {prefix}_animation_asset.dart
│   │           ├── {prefix}_icon_asset.dart
│   │           ├── {prefix}_illustration_asset.dart
│   │           └── {prefix}_logo_asset.dart
│   ├── analysis_options.yaml
│   └── pubspec.yaml
└── {app_name}_asset/
    ├── lib/
    │   ├── {app_name}_asset.dart           # Barrel file
    │   └── src/
    │       └── generated/
    │           ├── generated.dart
    │           ├── animations.dart
    │           ├── logos.dart
    │           └── icons/
    │               ├── icons.dart
    │               ├── actions_icons.dart
    │               ├── arrows_icons.dart
    │               ├── communication_icons.dart
    │               ├── essentials_icons.dart
    │               ├── feedback_icons.dart
    │               ├── files_icons.dart
    │               ├── finance_icons.dart
    │               ├── maps_icons.dart
    │               ├── media_icons.dart
    │               ├── security_icons.dart
    │               ├── time_icons.dart
    │               └── users_icons.dart
    ├── assets/
    │   ├── icons/                         # SVG icons by category
    │   │   ├── actions/
    │   │   ├── arrows/
    │   │   ├── communication/
    │   │   ├── essentials/
    │   │   ├── feedback/
    │   │   ├── files/
    │   │   ├── finance/
    │   │   ├── maps/
    │   │   ├── media/
    │   │   ├── security/
    │   │   ├── time/
    │   │   └── users/
    │   ├── animations/                    # Lottie JSON animations
    │   └── logos/                          # Logo assets
    ├── analysis_options.yaml
    └── pubspec.yaml

Built by Banua Coder