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 withSMenuItem
andSMenuItem.label
- Removed
SlidePageRoute
,FadePageRoute
, andSlideDirection
as they are uneccessary and unrelated. - Removed
SResizableMenuNoWrapper
. Instead, use the propertyenableWrapper
inSResizableMenu
. - Removed selected indicator on
SResizableMenu
. This added unwarranted complexity. Instead, the user must implement the indicator. See example.dart for more details. - Removed
SMenuItemButton
for same reason as indicator. Instead, the user must implement the button. See example.dart for more details.
Changed
- Renamed
SDropdownMenuAlignment
toSDropdownMenuPosition
. - Renamed
SDropdownMenu
toSBaseDropdownMenu
. - Fixed bug with dropdown menu's
showSelected
where it couldn't handled a null value. - Fixed bug where
header
andfooter
didn't work with dropdown menus. - Changed how
SDropdownMenuCascade
andSDropdownMenuMorph
handles items. It now only places anInkWell
over 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. TheonChange
function will be called with the item's value. - Changed items
parameter
of all menus to berequired
. - Changed
SMenuStyle
:- Removed
headerAlignment
,footerAlignment
,size
, andbarColor
. - Changed
borderRadius
to non-nullable and added default value ofconst BorderRadius.all(Radius.circular(15))
. - Added
barrierColor
with default valueColors.black26
. - Added a
copyWith
function that creates a new style object with same properties except for properties that were provided in the function.
- Removed
- Changed
SDropdownMenuStyle
:- Removed
alignment
,width
andheight
. Now part of the dropdown menu class. - Changed
borderRadius
to non-nullable and added default value ofconst BorderRadius.all(Radius.circular(15))
. - Added
barrierColor
defaultColors.black26
,border
,hideIcon
defaultfalse
,leadingIcon
defaultfalse
,showSelected
defaultfalse
, andisSmall
defaulttrue
. - Added a
copyWith
function that creates a new style object with same properties except for properties that were provided in the function.
- Removed
- Changed
SMenuItemStyle
:- Removed
selectedAccentColor
andselectedBgColor
. - Renamed mainAxisAlignment to alignment.
- Changed
borderRadius
to non-nullable and added default value ofconst BorderRadius.all(Radius.circular(15))
. - Added
mouseCursor
. - Added
side
for border. - Added a
copyWith
function 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
, andleadingIcon
toSDropdownMenuStyle
. - Added
height
,width
, animationcurve
,position
, andbuilder
.
- Moved
- Changed
SDropdownMenuMorph
(THIS IS A WIP):- Fixed bug where
showSelected
didn't work. - Renamed
itemStyle
tobuttonStyle
. - Moved
hideIcon
,barrierColor
,isSmall
,showSelected
, andleadingIcon
toSDropdownMenuStyle
. - Added
height
,width
, animationcurve
,position
, andbuilder
.
- Fixed bug where
- Changed
SDropdownMenuCascade
:- Moved
hideIcon
,barrierColor
,isSmall
,showSelected
, andleadingIcon
toSDropdownMenuStyle
. - Added
height
,width
, animationcurve
,position
, andbuilder
.
- Moved
- Changed
SResizableMenu
:- Removed
enableSelector
(see point #3 above for why). - Renamed
direction
toscrollDirection
. - Moved
barrierColor
toSMenuStyle
. - Added
closedSize
andopenSize
. - Added a new property
enableWrapper
, which does whatSResizableMenu
used 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
direction
toscrollDirection
. - Added
closedSize
andopenSize
.
- Removed
- Changed the
InkWell
so that shape, borderRadius, and colors now reflect each item's style rather than the style for the dropdown menu button.
Created
- Created a
performanceMode
for all the menus. When turned on, the scrollable will be aListView
, thus enabling lazy loading. Otherwise it is aSingleChildScrollView
which renders all items at once. If using abuilder
, this is not applicable. - Created
SBase
andSBaseState
abstract classes which theSBaseMenu
andSBaseDropdownMenu
are derived from. - Created
SMenuItemType
enum for theSMenuItem
to be able to build a widget based on the type. Useful becauseSMenuItem
now 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 type
is introduced and is set by each constructor so that the build function knows how to build the widget.preview
is introduced along withpreviewWidget
function. Thepreview
widget is what the user will see appear on the dropdown menu button whenshowSelected = true
. If it isnull
, it uses thebuild
method. 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)SBaseDropdownMenu
SBaseDropdownMenuState
SBaseMenu
SBaseMenuState
SDropdownMenuStyle
SMenuItemStyle
SMenuStyle
SMenuController
SDropdownMenuPosition
SMenuPosition
SMenuState
- (new) helper.dart (not exposed)
ResizeBar
_ResizeBarState
SDropdownMenuPopup
CustomHero
CustomRectTween
SPopupMenuRoute
- menu.dart
SSlideMenu
_SSlideMenuState
(not exposed)SResizableMenu
_SRresizableMenuState
(not exposed)
- dropdown.dart
SDropdownMenuCascade
_SDropdownMenuCascadeState
(not exposed)SDropdownMenuMorph
_SDropdownMenuMorphState
(not exposed)
- menu_item.dart
SMenuItem
SMenuItemType
(not exposed)
- (new) base.dart
1.0.1 #
- Added a
Offset? offset
paramter toSSlideMenu
to help determine the location of the menu. Initially it is at location (0, 0) - Added a
BoxBorder? border
paramter toSMenuStyle
to 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