Skip to content
pubscout

stealth_enum_generator

2.2.7, released 3 weeks ago by aslamambiloly.2bd.net

Code generator that transforms private enums into obfuscated extension types.

$ flutter pub add stealth_enum_generator
Source repository

What it does

The companion build_runner code generator for stealth_enum. It transforms @StealthEnum() annotated private Dart enums into zero-cost, obfuscated Dart 3 extension types to eliminate AOT binary metadata and neutralize reverse engineering pipelines.

AI-written summary of version 2.2.7, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to eliminate AOT binary metadata for sensitive enums in Dart or Flutter apps.
  • You need deterministic 32-bit hex values derived via keyed HMAC-SHA256 for enum constants.

Skip it when

  • You do not use code generation or build_runner in your project.
  • You want standard, native Dart enums without obfuscation layers.

Strengths

  • Zero-cost obfuscated extension types that remove AOT binary metadata.
  • Keyed HMAC-SHA256 derivation ensuring mathematical irreversibility.
  • Integrates seamlessly with SharedPartBuilder alongside other code generators.

Weaknesses

  • Requires build_runner and code generation setup.
  • Requires careful secret key management and build.yaml configuration.

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
5

Add stealth_enum to dependencies, build_runner and stealth_enum_generator to dev_dependencies, and optionally configure a secret key in build.yaml.

dependencies:
  stealth_enum: ^2.2.7

dev_dependencies:
  build_runner: ^2.4.0
  stealth_enum_generator: ^2.2.7

Alternatives

Packages that do the same job and could replace stealth_enum_generator.

Works with

Packages commonly used together with stealth_enum_generator: ones it builds on, ones built on it, and its own family.