flutter_preview_context_menu 0.4.0
flutter_preview_context_menu: ^0.4.0 copied to clipboard
A flexible WhatsApp-style context menu for Flutter with custom previews, top content, actions, animation, and viewport-aware overflow handling.
0.4.0 #
- Removed internal scrolling and height constraints from the action panel.
- Added
ContextMenuOverflowStrategy.pinActionsas the new default overflow behavior. - Kept the full action panel pinned to the bottom of the usable viewport while
scrolling only
topContentand the preview when the complete menu does not fit. - Added a whole-menu scrolling fallback when the action panel alone is taller than the viewport.
- Deprecated the legacy
repositionThenScroll,scrollPanel,maxPanelHeightFactor, andContextMenuPanel.maxHeightconfiguration while retaining source compatibility. - Added overflow tests for descriptive actions, pinned panels, and panels taller than the viewport.
0.3.0 #
- Added secondary-click activation for mouse and trackpad devices, enabled by default and configurable per region.
- Replaced the overlay
SafeAreawith explicit top and bottom device padding so horizontal layout can use the full viewport. - Added a complete runnable example for touch, mouse, custom previews, top content, and action styles.
- Expanded Dart API documentation and enabled the
public_member_api_docslint. - Added repository, issue tracker, and pub.flutter-io.cn topics metadata.
0.2.2 #
- Replaced the layered preview-specific motion with one synchronized transition for the complete menu.
- Made left-to-right, centered, and right-to-left entrance animations exact directional counterparts.
- Removed the ineffective hero-like preview animation and its obsolete configuration API.
- Fixed a build-time crash caused by reading widget size while Flutter was still building the overlay.
- Moved overlay content measurement to the post-layout phase so preview, top content, and action panels can open safely in the same frame.
- Added
panelElevationto customize the action panel shadow while keeping the default flat style at0. - Matched top content and action panel entrance motion to the resolved horizontal alignment.
- Prevented centered preview animations from sliding horizontally when the overlay has to clamp near screen edges.
- Updated action separators to use the current theme divider color.
0.2.1 #
- Changed the default action panel background to
ColorScheme.surfaceContainer. - Made
ContextMenuRegion.alignmentoptional. - Added automatic horizontal alignment: the menu centers on the pressed widget when it fits, then aligns to the closest source edge near screen boundaries.
- Added panel appearance customization for shape, background color, foreground color, barrier color, and blur.
0.2.0 #
- Added keyboard-aware focus handling when opening and closing a context menu.
- Added smoother entrance animation for top content and the actions panel.
- Added
ContextMenuActionandContextMenuRegion.actionChildrenfor widget-based custom actions with regular Flutter keys. - Removed the action identifier requirement from
ContextMenuActionData. - Updated documentation with the focus behavior and simplified action examples.
0.1.0 #
- Initial release.
- Added a long-press context menu region for any widget.
- Added customizable action rows with icons, descriptions, trailing widgets, disabled state, separators, and destructive styling.
- Added optional custom previews and top content.
- Added viewport-aware layout with configurable overflow strategies.
- Added optional preview animation from the pressed widget position.