arrow_popup 1.0.1
arrow_popup: ^1.0.1 copied to clipboard
A popup bubble with an arrow that points at any widget. Use it for tooltips, popovers, menus and dropdowns, with automatic placement and a controller.
Changelog #
1.0.1 #
- Changed: new
ArrowPopupStyledefaults:borderRadiusis 12 (was 10),paddingisEdgeInsets.zero(wasEdgeInsets.all(8)) andscreenMarginis 16 (was 10). Pass the old values to keep the previous look.
1.0.0 #
First stable release. The API is now covered by semantic versioning.
- Breaking:
ArrowPopupStyle.copyWithtakescoloras a plainColor?, not a function, and null keeps the current color like the other fields. To go back to the theme's default color, create a newArrowPopupStyle. closeDelaysets how long a hover popup stays after the mouse leaves the anchor and the bubble. The default is the same 100 milliseconds as before.
1.0.0-beta.1 #
First beta. The API is meant to be final; it is published as a beta to gather feedback before 1.0.0.
Popups #
ArrowPopupwidget: a bubble with an arrow that points at any widget, for tooltips, popovers, menus and dropdowns.ArrowPopup.builderopens the popup from a button it points at, without a controller.ArrowPopup.showopens a popup from code, pointing at the widget of aBuildContext.ArrowPopup.close(context, value)closes a popup from its content with a value, whichonClose,ArrowPopupController.showandArrowPopup.showreceive.ArrowPopupControlleropens and closes a popup from code, withshow,hide,toggleandisOpen.
Triggers #
- Opens on tap, long press, double tap or mouse hover, or from code.
waitDurationmakes hover wait before opening.autoCloseDurationcloses brief confirmations by itself.
Placement #
- Above, below, left, right, start or end of the anchor, or
auto. The popup moves to another side when there isn't room, so it never overflows. - Follows the anchor as it moves, scrolls or resizes, and closes once the anchor scrolls out of view or is removed.
Style #
ArrowPopupStylefor color, border, corner radius, padding, shadows, arrow size, gap, screen margin, max width, max height and clipping.- It can be set for the whole app as a
ThemeDataextension, or withArrowPopupThemein any app.
Accessibility and platforms #
- Right-to-left, keyboard and screen reader support, and reduced motion.
Hover popups give screen readers their
semanticLabelas the anchor's tooltip. - Works in apps without a Material theme, such as
CupertinoAppandWidgetsApp: the default colors, focus outline, text style and barrier label follow the Cupertino theme and the platform brightness.
