pull_down_button 0.10.2
pull_down_button: ^0.10.2 copied to clipboard
A package that implements Pull-Down Button from iOS 14 in Flutter. Highly customizable.
0.10.2 #
0.10.1 #
0.10.0 #
2024-08-03 - Multiple small improvements
Changed #
- Bump Flutter minimum supported version from 3.0 to 3.19.0.
- Bump Dart minimum supported version from 2.17.0 to 3.3.0.
- Change the default font family of pull-down menu items to
CupertinoSystemTextas it is the current default font family in Flutter's cupertino widgets.
Added #
- Add
useRootNavigatortoPullDownButtonandshowPullDownMenu(#49). Thanks to @gborges9. - Add
routeSettingstoPullDownButtonandshowPullDownMenu(#53). - Add
isOpenhelper getter toPullDownMenuButtonBuilder(#52). Thanks to @vizakenjack. - Add
PullDownMenuHeader.leadingBuilderto allow a more flexible creation of the header's leading widget (#50).
0.9.4 #
2024-04-18 - Menu animation alignment override
Added #
- Add
animationAlignmentOverridetoPullDownButton. This feature is experimental and may be removed in the future versions. - Add example for
PullDownButton.animationAlignmentOverride.
0.9.3 #
2023-07-28 - Menu scroll controller
Added #
- Add
scrollControllertoPullDownButton,PullDownMenuandshowPullDownMenuto allow passing custom scroll controller (#31).
Removed #
- Breaking: remove
initialScrollOffsetfromPullDownButton,PullDownMenuandshowPullDownMenuto allow more precise scroll controller customization usingscrollController.
0.9.2 #
0.9.1 #
0.9.0 #
2023-05-05 - Match guidelines from the Apple Design Resources Sketch file
Changed #
- Update the following stuff based on guidelines defined in the Apple Design Resources Sketch file:
- Update menu blur to include color saturation.
- Update the
PullDownMenuItemlayout. - Update the
PullDownMenuTitlelayout. - Update default height for
PullDownMenuActionsRow. - Update default height for
PullDownMenuTitle. - Update default theme values for all sub-themes.
- Update the example app to include newly added stuff.
- Deprecate
PullDownMenuDividerandPullDownMenuDivider.wrapWithDivider. Menu now inserts small dividers automatically. - Breaking: rename
PullDownMenuRouteTheme.largeTextScaleWidthtoPullDownMenuRouteTheme.accessibilityWidth.
Added #
- Add
PullDownMenuHeader. Based on UIDocumentProperties from iOS 16. - Add
subtitletoPullDownMenuItemandPullDownMenuItem.selectable. - Add
PullDownMenuTitle.alignmentto allow customizing alignment ofPullDownMenuTitle. - Add
subtitleStyle,onHoverBackgroundColor,onPressedBackgroundColor, andonHoverTextColortoPullDownMenuItemTheme.
Removed #
- Breaking: remove
dividerColorfromPullDownMenuActionsRow. - Breaking: remove
iconSize,checkmarkWeight,checkmarkSizefromPullDownMenuItemTheme. - Breaking: remove
onHoverColorfromPullDownMenuItemTheme. UseonHoverBackgroundColorinstead. - Breaking: remove
onHoverTextStylefromPullDownMenuItemTheme. UseonHoverTextColorinstead. - Breaking: remove
beginShadowandendShadowfromPullDownMenuRouteTheme. Useshadowinstead.
0.8.3 #
0.8.2 #
2023-04-11 - "Anchoring" to specific button side
Changed #
- Rename all nullable
of(context)methods tomaybeOf(context)to follow Flutter repo style.
Added #
- Add
PullDownButton.buttonAnchorto allow "anchoring" menu to specific button side (#22). - Add an example for
PullDownButton.buttonAnchor. See Examples -> Advanced in the example app. - Add haptic feedback when sliding between items (as seen in iOS).
0.8.1 #
2023-03-30 - Fixes for menu position calculations
Added #
-
Add precautions to menu position calculations for cases when
PullDownButton.buttonBuilder's height is bigger than the screen height (#21).Consider using
showPullDownMenuif the end position calculated using those precautions is not what was desired.
0.8.0 #
2023-03-30 - Improved menu positioning, new customization options
Changed #
- Breaking:
showPullDownMenuposition now requiresRectinstead ofRelativeRect. - Reworked the way the pull-down menu calculates its position on the screen:
- Updated menu's scale transition alignment calculation to closely match native.
- If opened from the left or right side of the screen (but not directly near the edge), additionally move the menu to the left or right by a certain amount of pixels (based on the native compare tool).
Added #
- Add
PullDownMenuItem.delayedTapHandler. - Add
PullDownButton.animationBuilderto allow customization of animation forPullDownButton.buttonBuilderwhen the pull-down menu is opening or closing. - Add an example for
PullDownButton.animationBuilder. See Examples -> Advanced in the example app.
Removed #
- Breaking: remove
PullDownMenuPosition.underandPullDownMenuPosition.above.PullDownMenuPosition.automaticshould be used instead (new default). - Breaking: remove
buttonSizeandmenuPositionfromshowPullDownMenu. - Breaking:
PullDownButton.applyOpacityandPullDownButtonTheme.applyOpacity. To remove opacity animation fromPullDownButton.buttonBuildersetPullDownButton.animationBuilderto null. - Breaking: remove
PullDownButton.offset.
0.7.0 #
2023-03-15 - Continuous swipe
Added #
-
Add "continuous swipe" support to menus (see demo) (#19, #18).
Thanks to @iSa1vatore.
0.6.5 #
0.6.4 #
0.6.3+1 #
0.6.2 #
2023-02-26 - Animation improvements
Changed #
-
Add menu height transition and updated open animation curve (#14, #15).
Thanks to @iSa1vatore.
0.6.1 #
0.6.0 #
2023-02-23 - Bringing looks closer to native
Changed #
- Update padding values for
PullDownMenuItem. - Update 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 an additional small amount of padding for menu positioning if the button is smaller than 44px.
- Update text style, checkmark configuration in
PullDownMenuItemThemedefaults. - Update shadows for dark mode in
PullDownMenuRouteThemedefaults.
Added #
- Add
PullDownMenuItemsOrder- an ordering logic forPullDownButtonandshowPullDownMenuitems. - Add native compare tool.
0.5.1 #
2023-01-23 - Text style merge fixes
Fixed #
- Fix
PullDownMenuItem.itemTheme.textStylebeing overridden by globalPullDownButtonTheme.itemTheme.textStyleduring text styles marge inPullDownMenuItemandPullDownMenuTitleif both are not null.
0.5.0 #
2023-01-11 - Bringing looks closer to native
Changed #
- Breaking:
PullDownMenuEntryno longer extendsStatelessWidget, it now extendsWidget. This was done to allowStatefulWidgets to be used asPullDownMenuEntry(#11). - Breaking:
PullDownMenuEntryno longer provides fields to override due to their redundancy. - 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
PullDownMenuDividerThemeandPullDownMenuRouteTheme. - On menu open opacity for
PullDownButton.buttonBuilder. PullDownMenuItemtext style and icon color opacity whenPullDownMenuItem.enabledis false.
PullDownMenuItemandPullDownMenuTitle- merge default text styles with provided ones (via theme or widget parameters).
Added #
- Add
showPullDownMenu- an alternative way to display menu (#12).
0.4.1 #
0.4.0 #
2022-11-22 - Theming overhaul
Changed #
Please see README for detailed info about new sub-themes.
- Modularize
PullDownButtonTheme- all properties where split into 4 sub-themes:- routeTheme - menu container theme (
PullDownMenuRouteTheme). - itemTheme -
PullDownMenuItemtheme (PullDownMenuItemTheme). - dividerTheme -
PullDownMenuDividertheme (PullDownMenuDividerTheme). - titleTheme -
PullDownMenuTitletheme (PullDownMenuTitleTheme).
- routeTheme - menu container theme (
- All customization options that were previously available on menu items are now also using 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,
),
),
)
Added #
- Add customization of menu's border radius, begin and end shadows to
PullDownMenuRouteTheme(#8).
Removed #
- Breaking: replace
SelectablePullDownMenuItemwithPullDownMenuItem.selectable. - Breaking: remove
PullDownMenuIconAction-PullDownMenuActionsRownow usesPullDownMenuItem. - Breaking: remove
PullDownMenuWidthConfiguration- usePullDownMenuRouteTheme.width.
0.3.0 #
0.2.0-beta.1.1 #
2022-09-27 - PullDownMenuPosition.automatic
Changed #
- Breaking: update
PullDownMenuDivider's constructors - deprecate (removed any usages)dividerColorandlargeDividerColorfromPullDownMenuDividerandPullDownMenuDivider.largerespectively. Both constructors now use samecolorproperty. - Default
PullDownMenuPositionofPullDownButtonis nowundersince this behaviour is the most frequent across iOS system apps. - Rework 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.
Fixed #
- Fix issue where it was not possible to open pull-down menu when no items where provided to
PullDownMenuDivider.wrapWithDivider.
0.1.0-beta.8 #
0.1.0-beta.7 #
0.1.0-beta.6 #
0.1.0-beta.5 #
0.1.0-beta.4 #
2022-06-29 - Various fixes
Changed #
- Replace
SizedBoxwithConstrainedBoxinPullDownMenuTitleto allowPullDownMenuTitleto have adaptive height. - Update
largeDividerColorinPullDownButtonThemeDefaultsto more correct value. - Bump Flutter minimum supported version from beta 2.13.0-0 to 3.0.
Added #
- Add
iconColorandiconWidgetparameters toPullDownMenuItemandSelectablePullDownMenuItem.
Fixed #
- Fix menu background color "jumping" during open animation.
- Fix
showDialog(and other actions that change navigation stack) to work directly without any workarounds (#1):
Migration
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) => ...,
),
