guardify 1.1.1
guardify: ^1.1.1 copied to clipboard
A Dart code generation package for Role-Based UI Access Control in Flutter widgets.
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.