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.
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.
| Param | Default |
|---|---|
child | required |
title | null |
message | null |
opacity | 0.5 |
LockedSurface
Full-bleed "Access Restricted" placeholder for denied tabs, routes, or sections. Renders a centered lock icon with a default headline and explanation.
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.
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.
Cross-links
- Theming —
surfaceContainer,onSurfaceVariant - The higher-level entity-system authorization pipeline lives in
vyuh_entity_system_ui— it dispatches betweenDisabledOverlay,LockedSurface, andRedactedValuebased on the resolved permission outcome.