guardify 1.1.2 copy "guardify: ^1.1.2" to clipboard
guardify: ^1.1.2 copied to clipboard

A Dart code generation package for Role-Based UI Access Control in Flutter widgets.

1.1.2 #

  • ๐Ÿงน Dart 3.0+ Null-Aware Collection Elements: Updated SecuredGenerator template to use null-aware pattern matching (if (... case final role?) role and ...?) to eliminate use_null_aware_elements linter warnings.
  • โšก Const Constructor Optimization: Automatically injects const keyword for 0-argument const target constructor invocations in generated .secured.g.dart widgets, eliminating prefer_const_constructors linter warnings and improving runtime performance.

1.1.1 #

  • ๐Ÿ› Named Constructor Selection: Added automatic fallback to the first public constructor for widgets with named constructors (e.g. MyWidget.primary(...)).
  • ๐Ÿ”‘ Dual Enum Role Matching: Extracted both short Enum name ('admin') and qualified Enum name ('DemoRole.admin') for seamless Enum role resolution.
  • ๐Ÿ›ก๏ธ Reserved Parameter Collision Fix: Prevented property name collisions when target widget constructors use parameters named currentRole, currentRoles, or fallback.

1.1.0 #

  • ๐Ÿš€ Generic Widget Support (<T>): Generates type-safe wrapper classes preserving generic type parameters and bounds (e.g. SecuredGenericDataCard<T>).
  • ๐Ÿ”‘ Enum & Constant Role Extraction: @Secured annotations now support Enum instances and constant objects in allowedRoles (e.g. @Secured([UserRole.admin])).
  • ๐Ÿ›ก๏ธ AST Compile-Time Guardrails: Strict validation ensuring @Secured is only applied to Flutter Widget classes and enforcing non-empty allowedRoles lists.
  • ๐ŸŽจ Code Builder & Formatting: Integrated DartFormatter from dart_style for clean, formatted generated output.

1.0.0 #

  • ๐Ÿ›ก๏ธ Initial Release of Guardify - Role-Based UI Access Control (RBAC) code generator for Flutter.
  • @Secured Annotation: Support for allowedRoles, fallback UI strategies (hide, scaffold, text), requireAll matching logic, and custom class name overrides.
  • SecuredGenerator: Generates type-safe, idiomatic Secured<ClassName> widget wrappers with constructor parameter forwarding.
  • GuardifyScope: Ambient role state resolution via InheritedWidget to eliminate prop-drilling across widget trees.
  • BuildContext Extensions: Convenience getters including context.hasRole(), context.hasAnyRole(), context.hasAllRoles(), and context.isAuthorized().
  • Custom Permission Checker: Support for dynamic permission callbacks (Firebase Auth claims, JWT rules) via permissionChecker.
1
likes
0
points
253
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart code generation package for Role-Based UI Access Control in Flutter widgets.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, code_builder, dart_style, flutter, meta, source_gen

More

Packages that depend on guardify