Popover
A popover attaches a short explanation or a small control to the object it describes. Keep the anchor visible so readers can recover their place.
Read sharing details
#Open Sharing details to see who can read the file. Dismiss the note and open it once more with the keyboard.
components/popover/appliance/read_sharing_details.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class ReadSharingDetails extends StatelessWidget {
const ReadSharingDetails({super.key});
@override
Widget build(BuildContext context) => AppliancePopover(
semanticLabel: 'Sharing details',
builder: (_, anchor) =>
ApplianceButton('Sharing details', onPressed: anchor.toggle),
content: (_, close) =>
const Text('Only invited people can read this file.'),
);
}
Parameters
AppliancePopover API ↗builder- Builds the control that opens the popover.
content- Supplies the note inside the open panel.
semanticLabel- Names the panel for assistive technology.
width- Sets the preferred width of the open panel.
Shared behaviour
- Keyboard and focus. Tab to Sharing details and activate it. Try Escape and a press outside the panel to dismiss it.
- Screen readers. The trigger names the subject. Read the note in the open panel, then return to the trigger.
- Direction and type. Try the note near the edge of a phone-sized preview with larger type. It should remain close to its trigger.