stealth_enum 2.0.0
stealth_enum: ^2.0.0 copied to clipboard
Obfuscates Dart enums into zero-cost extension types backed by high-entropy integers, eliminating enum metadata from Flutter AOT binaries.
2.0.0 #
New Features #
- Added
generateLabelannotation parameter (defaultfalse). When enabled, the generator emits.labelgetter,byLabel(String),toJson(), andfromJson(int)helpers — equivalent to.name,byName(), and JSON converters on standard enums. - Added comprehensive Migration Guide in README covering pattern matching, JSON serialization (including
json_serializablecustom converter pattern), logging, persistence, and side-by-side standard enum → stealth_enum cheatsheet. - Added AOT Verification Script (
scripts/verify_aot_strings.sh) that compiles the example to a native AOT binary and asserts all enum identifier strings are absent using thestringsCLI tool. - Updated feature table to include Safe Parsing row comparing
tryFromRawValuevsbyName(which throws on unknown values).
Breaking Changes #
- Generator version constraint updated:
stealth_enum_generator: ^2.0.0requiresstealth_enum: ^2.0.0. Update both packages together.
1.0.5 #
- Added
tryFromRawValue()for safe, null-returning parsing of untrusted inputs (APIs, JSON, databases) to prevent runtime crashes. - Added
isValidboolean getter to verify if an instance holds a recognized enum variant. - Documented compile-time and runtime safety guarantees in README and llms.txt.
1.0.4 #
- Hardened generated pattern matching: all cases are now explicit and wildcard branches fail closed.
- Updated documentation and examples.
1.0.3 #
- Added unit test suite for
StealthEnumannotation. - Enhanced example and documentation.
- Updated CI/CD workflow actions.
1.0.1 #
- Improved README formatting and line breaks in documentation.
- Updated badges and preview graphics.
1.0.0 #
- Production ready 1.0.0 release.
- Zero runtime overhead and complete enum metadata erasure in Flutter AOT binaries.
- Full compatibility with Dart 3.3+ and Flutter 3.19+.
0.1.1 #
- Added package example in
example/example.dart. - Added dartdoc comments for
StealthEnumconstructor. - Refined package description to adhere to pub.dev length guidelines.
0.1.0 #
- Initial release.
@StealthEnumannotation withseed,generateWhen, andnameparameters.- Dart 3.3+
extension typeoutput backed by deterministic, collision-free 32-bit hex integers. - Inlined exhaustive
.when()and.maybeWhen()helpers with@pragma('vm:prefer-inline'). - No
StateErrorstrings in the binary — finalwhenbranch uses wildcard_ =>. - Compatible with
SharedPartBuilderalongsidejson_serializable,freezed, andriverpod_generator.