Skip to content

FlutterAssetsGenerator 3.2.0

Latest

Choose a tag to compare

@cr1992 cr1992 released this 30 Mar 06:49
· 9 commits to master since this release

[3.2.0]

Added / 新增

  • Enable Config: Added enable to explicitly control whether a module participates in watching and generation.
    • 启用开关: 新增 enable 配置,用于显式控制模块是否参与监听和生成。
  • Leaf Type Config: Added leaf_type for robust style so hierarchical APIs can return either typed wrappers or raw String paths.
    • 叶子类型配置: 为 robust 风格新增 leaf_type 配置,支持在保留分层 API 的同时选择返回包装类型或原始 String 路径。

Changed / 变更

  • YAML Source of Truth: 3.x now treats pubspec.yaml as the source of truth. Modules without a flutter_assets_generator block are no longer watched or generated automatically.
    • YAML 单一配置源: 3.x 以后统一以 pubspec.yaml 为准。未配置 flutter_assets_generator 的模块不再自动监听或生成。

Fixed / 修复

  • Name Style Handling: Fixed name_style handling so generated identifiers now consistently respect camel and snake.
    • 命名风格处理: 修复 name_style 配置未被完整应用的问题,确保生成标识符稳定遵循 camelsnake
  • Legacy Naming Compatibility: Restored legacy flat naming behavior for numeric assets such as assets/images/0.png -> Assets.images0.
    • Legacy 命名兼容: 恢复旧版扁平命名在数字资源下的兼容行为,例如 assets/images/0.png -> Assets.images0
  • Robust Directory Naming: Directory helper classes now use the full physical asset path to avoid collisions when different roots share the same folder name or tree shape.
    • Robust 目录命名: 目录内部类改为基于完整物理路径生成,修复不同资源根目录同名或同结构目录发生冲突的问题。
  • Robust Root Flattening: Root flattening now only applies to a single assets/ root so intermediate directories remain stable in deep paths.
    • Robust 根目录扁平化: 根目录扁平化现在仅对单一 assets/ 根生效,避免深层路径丢失中间目录。