Skip to content

Authorization

Three small widgets for surfaces that may be denied or partially visible to the current user. They pair with the higher-level authorization pipeline in vyuh_entity_system_ui, but work standalone.

DisabledOverlay

Wrap any widget so it renders dimmed and non-interactive. Pointer events are absorbed (AbsorbPointer) and visibility is muted via Opacity. Hovering reveals a tooltip explaining why.

dart
DisabledOverlay(
  title: 'Read-only',
  message: 'Approved batches cannot be edited.',
  child: BatchEditor(batch: batch),
)

// Without a tooltip — passive dim
DisabledOverlay(
  opacity: 0.4,
  child: ExpensiveActionButton(),
)

Pairs with AuthorizeFallback.disable in the entity-system authorization pipeline.

ParamDefault
childrequired
titlenull
messagenull
opacity0.5

LockedSurface

Full-bleed "Access Restricted" placeholder for denied tabs, routes, or sections. Renders a centered lock icon with a default headline and explanation.

dart
LockedSurface(
  title: 'Requires QA Lead role',
  message: 'Contact your administrator to request access.',
)

// Or use the defaults:
const LockedSurface()

Defaults:

  • Title: 'Access Restricted'
  • Message: "You don't have permission to view this content. Contact your administrator if you need access."

The card stretches to its parent's constraints (SizedBox.expand) so it reads as the full surface, not a popover.

RedactedValue

Inline placeholder mask for redacted field values. Drop it anywhere a real value would normally appear.

dart
Row(children: [
  const Text('SSN: '),
  user.canViewSsn ? Text(user.ssn) : const RedactedValue(),
])

// Custom mask
RedactedValue(mask: '████████')

Renders the mask glyph (•••• by default) in a muted style with extra letter spacing.

  • ThemingsurfaceContainer, onSurfaceVariant
  • The higher-level entity-system authorization pipeline lives in vyuh_entity_system_ui — it dispatches between DisabledOverlay, LockedSurface, and RedactedValue based on the resolved permission outcome.