pull_down_button 0.8.1 pull_down_button: ^0.8.1 copied to clipboard
A package that implements Pull-Down Button from iOS 14 in Flutter. Highly customizable.
0.8.1 #
-
Added precautions to menu position calculations for cases when
PullDownButton.buttonBuilder
's height is bigger than screen height.Consider using
showPullDownMenu
if the end position calculated using those precautions is not what was desired.
0.8.0 #
BREAKING CHANGES #
- Removed
PullDownMenuPosition.under
andPullDownMenuPosition.above
.PullDownMenuPosition.automatic
should be used instead (new default). showPullDownMenu
position now requiresRect
instead ofRelativeRect
, buttonSize and menuPosition were removed.- Removed
PullDownButton.applyOpacity
andPullDownButtonTheme.applyOpacity
. To remove opacity animation fromPullDownButton.buttonBuilder
setPullDownButton.animationBuilder
to null. - Removed
PullDownButton.offset
.
General updates
- Reworked the way pull-down menu calculates its position on screen:
- Updated menu's scale transition alignment calculation to closely match native.
- If opened from left or right side of screen (but not directly near the edge), additionally move menu to the left or right by certain amount of pixels (based on native compare tool).
- Added
PullDownMenuItem.delayedTapHandler
. - Added
PullDownButton.animationBuilder
to allow customization of animation forPullDownButton.buttonBuilder
when pull-down menu is opening or closing.
Various stuff
- Cleaned up internals.
- Added an example for
PullDownButton.animationBuilder
. See Examples -> Advanced in example app.
0.7.0 #
- Added "continuous swipe" support to menus (see demo) #19 and #18 Thanks to @iSa1vatore
0.6.5 #
- Added
PullDownMenu
- a pull-down menu as a simple widget, with no animations or adding routes to navigation stack #17. - Updated
PullDownMenuItem.defaultTapHandler
to work withPullDownMenu
.
Various stuff
- Cleaned up internals.
0.6.4 #
- Added
PullDownMenuItem.tapHandler
to allow customization of howPullDownMenuItem.onTap
is handled #16. - Added an example for
PullDownMenuItem.tapHandler
. See Examples -> Advanced in example app.
0.6.3+1 #
- Fix
PullDownMenuItemTheme.lerp
using incorrect text styles for lerping. - Added clamped animation for menu animations, updated shadow animation.
0.6.2 #
- Added menu height transition and updated open animation curve #14 and #15. Thanks to @iSa1vatore
0.6.1 #
- Fix
PullDownMenuActionsRow
items content not being centered;
0.6.0 #
- Added
PullDownMenuItemsOrder
- an ordering logic forPullDownButton
andshowPullDownMenu
items.
Using new native compare tool following things were updated:
- Updated padding values for
PullDownMenuItem
. - Updated open / close animation curves - open curve now includes "bouncy" effect native counterpart has #13.
- Note: new curves are still not 100% equal to native, but slightly more similar than before.
- Apply additional small amount of padding for menu positioning if button is smaller than 44px.
Theme updates
- Updated text style, checkmark configuration in
PullDownMenuItemTheme
defaults. - Updated shadows for dark mode in
PullDownMenuRouteTheme
defaults.
Various stuff
- Updated README screenshots.
- Theme resolvers.
- Added native compare tool.
0.5.1 #
- Fix
PullDownMenuItem.itemTheme.textStyle
being overridden by globalPullDownButtonTheme.itemTheme.textStyle
during text styles marge inPullDownMenuItem
andPullDownMenuTitle
if both are not null.
0.5.0 #
- Added
showPullDownMenu
- an alternative way to display menu #12. - Following things have been updated to be a lot closer to native variant:
- Menu open / close animation to use scaling transition.
PullDownMenuTitle
- minimum height to be equal to native variant.- Default colors for
PullDownMenuDividerTheme
andPullDownMenuRouteTheme
. - On menu open opacity for
PullDownButton.buttonBuilder
. PullDownMenuItem
text style and icon color opacity whenPullDownMenuItem.enabled
is false.
PullDownMenuItem
andPullDownMenuTitle
- merge default text styles with provided ones (via theme or widget parameters).
BREAKING CHANGES #
-
PullDownMenuEntry
no longer provides fields to override due to their redundancy. -
PullDownMenuEntry
no longer extendsStatelessWidget
, it now extendsWidget
. This was done to allowStatefulWidget
s to be used asPullDownMenuEntry
#11.Migration:
Before
class PullDownMenuItem extends PullDownMenuEntry {
After
class PullDownMenuItem extends StatelessWidget implements PullDownMenuEntry {
0.4.1 #
- Do not use
BackdropFilter
for blur used in pull-down menu if menu's background color is fully opaque #9
0.4.0 #
BREAKING CHANGES #
Menu items
- Simplified API - action related menu items below are being replaced with
PullDownMenuItem
:- Replaced
SelectablePullDownMenuItem
withPullDownMenuItem.selectable
. - Removed
PullDownMenuIconAction
-PullDownMenuActionsRow
now usesPullDownMenuItem
.
- Replaced
Theming
-
Modularize
PullDownButtonTheme
- sincePullDownButtonTheme
was becoming a bit overcrowded all properties where split into 4 sub-themes:- routeTheme - menu container theme (
PullDownMenuRouteTheme
). - itemTheme -
PullDownMenuItem
theme (PullDownMenuItemTheme
). - dividerTheme -
PullDownMenuDivider
theme (PullDownMenuDividerTheme
). - titleTheme -
PullDownMenuTitle
theme (PullDownMenuTitleTheme
).
All customization options that were previously available on menu items are now also using sub-themes.
Please see README for detailed info about new sub-themes.
Migration:
Before
PullDownButtonTheme( backgroundColor: colorScheme.surface, dividerColor: colorScheme.outline, largeDividerColor: colorScheme.outlineVariant, destructiveColor: colorScheme.error, textStyle: TextStyle( color: colorScheme.onSurface, ), titleStyle: TextStyle( color: colorScheme.onSurface, ), widthConfiguration: const PullDownMenuWidthConfiguration(280), )
After
PullDownButtonTheme( routeTheme: PullDownMenuRouteTheme( backgroundColor: colorScheme.surface, width: 280, ), dividerTheme: PullDownMenuDividerTheme( dividerColor: colorScheme.outline, largeDividerColor: colorScheme.outlineVariant, ), itemTheme: PullDownMenuItemTheme( destructiveColor: colorScheme.error, textStyle: TextStyle( color: colorScheme.onSurface, ), ), titleTheme: PullDownMenuTitleTheme( style: TextStyle( color: colorScheme.onSurface, ), ), )
- routeTheme - menu container theme (
-
Removed
PullDownMenuWidthConfiguration
- usePullDownMenuRouteTheme.width
. -
PullDownMenuRouteTheme
- added customization of menu's border radius, begin and end shadows #8.
0.3.0 #
- Added
PullDownMenuActionsRow
- displays multiple actions in a row (from iOS 16), iOS docs. - New examples.
- Updated readme images.
0.2.0-beta.1.1 #
- Fix issue where it was not possible to open pull-down menu when no items where provided to
PullDownMenuDivider.wrapWithDivider
. - Updated examples.
BREAKING CHANGES:
-
Update
PullDownMenuDivider
's constructors - deprecate (removed any usages)dividerColor
andlargeDividerColor
fromPullDownMenuDivider
andPullDownMenuDivider.large
respectively. Both constructors now use samecolor
property.Migration:
PullDownMenuDivider(dividerColor: Colors.black) -> PullDownMenuDivider(color: Colors.black) PullDownMenuDivider.large(largeDividerColor: Colors.black) -> PullDownMenuDivider.large(color: Colors.black)
-
Default
PullDownMenuPosition
ofPullDownButton
is nowunder
since this behaviour is the most frequent across iOS system apps. -
Reworked the way menus are rendered on screen (position and size) and added new position mode
automatic
#5:over
- will attempt to fill as much space as possible.under
- is forced to be under an anchor. If there is no available space, will be placed above an anchor.above
- is forced to be above an anchor. If there is no available space, will be placed under an anchor.automatic
- is positioned under or above an anchor depending on side that has more space available.
0.1.0-beta.7 #
- Added
onHoverColor
toPullDownButtonTheme
+ support for mouse pointers forPullDownMenuItem
#6.
0.1.0-beta.6 #
- Added ability to choose to whether apply opacity on menu open for
PullDownButton.buttonBuilder
or not #4.
0.1.0-beta.4 #
-
Fix
showDialog
(and other actions that change navigation stack) to work directly without any workarounds #1:Instead of
onTap: () async { await Future<void>.delayed(const Duration(milliseconds: 1)); await showDialog<void>( context: context, builder: (context) => ..., ); },
Now is possible to write it like this:
onTap: () => showDialog<void>( context: context, builder: (context) => ..., ),
-
PullDownMenuItem
andSelectablePullDownMenuItem
- addediconColor
andiconWidget
parameters. -
PullDownMenuTitle
replaceSizedBox
withConstrainedBox
to allowPullDownMenuTitle
to have adaptive height. -
Update
largeDividerColor
inPullDownButtonThemeDefaults
to more correct value. -
Fix menu background color "jumping" during open animation.
-
Remove Flutter beta 2.13.0-0 as minimum supported version - now it's 3.0.
0.1.0-beta.3 #
- Added
PullDownButtonInheritedTheme
as an additional way of defining globalPullDownButtonTheme
#2.
0.1.0-beta.2 #
- Added shadow behind pull-down menu.
- Update pull-down menu show/hide animations to be more similar to native version.
PullDownMenuItem
andSelectablePullDownMenuItem
- replaceInkWell
withGestureDetector
.- Improve pull-down menu positioning on screen.
- Fix pull-down animating from the top instead of bottom for
PullDownMenuPosition.above
.
0.1.0-beta.1 #
- Initial release.