flutter_smenus 2.0.0
flutter_smenus: ^2.0.0 copied to clipboard
Flutter package for all sorts of menus from dropdowns to sliding to resizable to navigation menus
Change log #
2.0.0 #
Removed
- Removed
SMenuItemDropdownSelectable,SMenuItem,SMenuItemDropdown, andSMenuItemCustom. They have been replaced withSMenuItemandSMenuItem.label - Removed
SlidePageRoute,FadePageRoute, andSlideDirectionas they are uneccessary and unrelated. - Removed
SResizableMenuNoWrapper. Instead, use the propertyenableWrapperinSResizableMenu. - Removed selected indicator on
SResizableMenu. This added unwarranted complexity. Instead, the user must implement the indicator. See example.dart for more details. - Removed
SMenuItemButtonfor same reason as indicator. Instead, the user must implement the button. See example.dart for more details.
Changed
- Renamed
SDropdownMenuAlignmenttoSDropdownMenuPosition. - Renamed
SDropdownMenutoSBaseDropdownMenu. - Fixed bug with dropdown menu's
showSelectedwhere it couldn't handled a null value. - Fixed bug where
headerandfooterdidn't work with dropdown menus. - Changed how
SDropdownMenuCascadeandSDropdownMenuMorphhandles items. It now only places anInkWellover the item if it is of typeSMenuItem.clickable. If the it is, the item will display a preview of the item that is selected and the dropdown menu will close when the item is clicked. TheonChangefunction will be called with the item's value. - Changed items
parameterof all menus to berequired. - Changed
SMenuStyle:- Removed
headerAlignment,footerAlignment,size, andbarColor. - Changed
borderRadiusto non-nullable and added default value ofconst BorderRadius.all(Radius.circular(15)). - Added
barrierColorwith default valueColors.black26. - Added a
copyWithfunction that creates a new style object with same properties except for properties that were provided in the function.
- Removed
- Changed
SDropdownMenuStyle:- Removed
alignment,widthandheight. Now part of the dropdown menu class. - Changed
borderRadiusto non-nullable and added default value ofconst BorderRadius.all(Radius.circular(15)). - Added
barrierColordefaultColors.black26,border,hideIcondefaultfalse,leadingIcondefaultfalse,showSelecteddefaultfalse, andisSmalldefaulttrue. - Added a
copyWithfunction that creates a new style object with same properties except for properties that were provided in the function.
- Removed
- Changed
SMenuItemStyle:- Removed
selectedAccentColorandselectedBgColor. - Renamed mainAxisAlignment to alignment.
- Changed
borderRadiusto non-nullable and added default value ofconst BorderRadius.all(Radius.circular(15)). - Added
mouseCursor. - Added
sidefor border. - Added a
copyWithfunction that creates a new style object with same properties except for properties that were provided in the function.
- Removed
- Changed
SDropdownMenuCascade:- Moved
hideIcon,barrierColor,isSmall,showSelected, andleadingIcontoSDropdownMenuStyle. - Added
height,width, animationcurve,position, andbuilder.
- Moved
- Changed
SDropdownMenuMorph(THIS IS A WIP):- Fixed bug where
showSelecteddidn't work. - Renamed
itemStyletobuttonStyle. - Moved
hideIcon,barrierColor,isSmall,showSelected, andleadingIcontoSDropdownMenuStyle. - Added
height,width, animationcurve,position, andbuilder.
- Fixed bug where
- Changed
SDropdownMenuCascade:- Moved
hideIcon,barrierColor,isSmall,showSelected, andleadingIcontoSDropdownMenuStyle. - Added
height,width, animationcurve,position, andbuilder.
- Moved
- Changed
SResizableMenu:- Removed
enableSelector(see point #3 above for why). - Renamed
directiontoscrollDirection. - Moved
barrierColortoSMenuStyle. - Added
closedSizeandopenSize. - Added a new property
enableWrapper, which does whatSResizableMenuused to do (add a wrapper). This removed the need for a seperate classSResizableMenuNoWrapper.
- Removed
- Changed
SSlideMenu:- Removed
enableSelector(see point #3 above for why). - Renamed
directiontoscrollDirection. - Added
closedSizeandopenSize.
- Removed
- Changed the
InkWellso that shape, borderRadius, and colors now reflect each item's style rather than the style for the dropdown menu button.
Created
- Created a
performanceModefor all the menus. When turned on, the scrollable will be aListView, thus enabling lazy loading. Otherwise it is aSingleChildScrollViewwhich renders all items at once. If using abuilder, this is not applicable. - Created
SBaseandSBaseStateabstract classes which theSBaseMenuandSBaseDropdownMenuare derived from. - Created
SMenuItemTypeenum for theSMenuItemto be able to build a widget based on the type. Useful becauseSMenuItemnow has multiple constructors. Internal use only. - Created
SMenuItem,SMenuItem.clickable,SMenuItem.switchable(WIP), andSMenuItem.label. This works by having multiple constructors and settings variables not needed by that constructor tonull. A new variableSMenuItemType typeis introduced and is set by each constructor so that the build function knows how to build the widget.previewis introduced along withpreviewWidgetfunction. Thepreviewwidget is what the user will see appear on the dropdown menu button whenshowSelected = true. If it isnull, it uses thebuildmethod. WIP forSMenuItem.switchable, not yet available.
Other
- Updated README.md, code formatting, and example code
- Example code now have the indicator implemented rather than it being in-built in this package (for reasons explained above, see points #4 and #5 under Removed).
- Reorganized file/class system:
- (new) base.dart
SBase(not exposed)SBaseState(not exposed)SBaseDropdownMenuSBaseDropdownMenuStateSBaseMenuSBaseMenuStateSDropdownMenuStyleSMenuItemStyleSMenuStyleSMenuControllerSDropdownMenuPositionSMenuPositionSMenuState
- (new) helper.dart (not exposed)
ResizeBar_ResizeBarStateSDropdownMenuPopupCustomHeroCustomRectTweenSPopupMenuRoute
- menu.dart
SSlideMenu_SSlideMenuState(not exposed)SResizableMenu_SRresizableMenuState(not exposed)
- dropdown.dart
SDropdownMenuCascade_SDropdownMenuCascadeState(not exposed)SDropdownMenuMorph_SDropdownMenuMorphState(not exposed)
- menu_item.dart
SMenuItemSMenuItemType(not exposed)
- (new) base.dart
1.0.1 #
- Added a
Offset? offsetparamter toSSlideMenuto help determine the location of the menu. Initially it is at location (0, 0) - Added a
BoxBorder? borderparamter toSMenuStyleto add a border around the Resizable or Slide menus. - Updated README.md, code formatting, and example code
1.0.0 #
- INITIAL RELEASE: Package officially released with four main types of menus. SMenuResizable, SSlideMenu, SDropdownMenuCascade, and SDropdownMenuMorph