guardify 1.1.3
guardify: ^1.1.3 copied to clipboard
A Dart code generation package for Role-Based UI Access Control in Flutter widgets.
1.1.3 #
- ๐งน Dart Linter
use_null_aware_elementsFix: RefactoredSecuredGeneratortemplate to constructactiveRolesSet imperatively using.add()and.addAll()with local variable type promotion (directRole,directRoles,scopeRole,scopeRoles), completely eliminating collection-if checks and resolvinguse_null_aware_elementslinter warnings across all Dart 3.0+ linter configurations.
1.1.2 #
- ๐งน Dart 3.0+ Null-Aware Collection Elements: Updated
SecuredGeneratortemplate to use null-aware pattern matching (if (... case final role?) roleand...?) to eliminateuse_null_aware_elementslinter warnings. - โก Const Constructor Optimization: Automatically injects
constkeyword for 0-argument const target constructor invocations in generated.secured.g.dartwidgets, eliminatingprefer_const_constructorslinter 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, orfallback.
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:
@Securedannotations now support Enum instances and constant objects inallowedRoles(e.g.@Secured([UserRole.admin])). - ๐ก๏ธ AST Compile-Time Guardrails: Strict validation ensuring
@Securedis only applied to FlutterWidgetclasses and enforcing non-emptyallowedRoleslists. - ๐จ Code Builder & Formatting: Integrated
DartFormatterfromdart_stylefor clean, formatted generated output.
1.0.0 #
- ๐ก๏ธ Initial Release of Guardify - Role-Based UI Access Control (RBAC) code generator for Flutter.
@SecuredAnnotation: Support forallowedRoles,fallbackUI strategies (hide,scaffold,text),requireAllmatching logic, and custom classnameoverrides.SecuredGenerator: Generates type-safe, idiomaticSecured<ClassName>widget wrappers with constructor parameter forwarding.GuardifyScope: Ambient role state resolution viaInheritedWidgetto eliminate prop-drilling across widget trees.BuildContextExtensions: Convenience getters includingcontext.hasRole(),context.hasAnyRole(),context.hasAllRoles(), andcontext.isAuthorized().- Custom Permission Checker: Support for dynamic permission callbacks (Firebase Auth claims, JWT rules) via
permissionChecker.