Can constructor

const Can({
  1. Key? key,
  2. required String I,
  3. required String a,
  4. required Widget? child,
  5. bool not = false,
  6. Widget? fallback,
})

Creates a Can widget that displays child if permission is granted.

  • I represents the action being checked.
  • a represents the subject being checked.
  • child is displayed if permission is granted.
  • fallback is displayed if permission is denied (defaults to an empty widget).
  • If not is true, the logic is reversed, displaying child when permission is denied.

Implementation

const Can({
  Key? key,
  required this.I,
  required this.a,
  required this.child,
  this.not = false,
  this.fallback,
})  : abilityBuilder = null,
      super(key: key);