GrockMenu constructor
const
GrockMenu({
- Key? key,
- required Widget child,
- required List<
GrockMenuItem> items, - dynamic onTap(
- int value
- GrockMenuController? controller,
- ScrollPhysics? physics,
- int? maxHeight,
- double? minWidth,
- BorderRadiusGeometry? borderRadius,
- Color? dividerColor,
- double? dividerHeight = 1.0,
- GrockMenuTapType tapType = GrockMenuTapType.onTap,
- TextStyle? textStyle,
- Color? backgroundColor,
- BoxBorder? border,
- Color? pressColor = Colors.white,
- int? maxLines,
- TextAlign? textAlign,
- TextOverflow? textOverflow = TextOverflow.ellipsis,
- EdgeInsetsGeometry? padding,
- bool onTapClose = true,
- Color spaceColor = Colors.black26,
- Duration openAnimationDuration = const Duration(milliseconds: 300),
- Duration closeAnimationDuration = const Duration(milliseconds: 250),
- Curve openAnimation = Curves.fastOutSlowIn,
- Curve closeAnimation = Curves.linear,
- Alignment? openAlignment,
- double backgroundBlur = 40.0,
- double spaceBlur = 1.0,
- double? leftSpace,
- double? rightSpace,
- double? topSpace,
- double? bottomSpace,
- Tween<
double> ? tween, - Decoration? backgroundDecoration,
- Widget divider(
- BuildContext context,
- int index
- bool isTopSpace = false,
- bool isLeftSpace = false,
- GrockMenuAnimationType animationType = GrockMenuAnimationType.none,
- Tween<
Offset> ? slideTween,
Implementation
const GrockMenu({
Key? key,
/// The child is the widget that will be displayed when the menu is closed.
required this.child,
/// The items are the menu items that will be displayed when the menu is open.
required this.items,
/// The onTap is the callback that will be called when the menu item is tapped.
this.onTap,
/// The controller is the controller that will be used to control the menu.
this.controller,
/// The physics is the physics that will be used to control the menu.
this.physics,
/// The maxHeight is the maximum height of the menu.
this.maxHeight,
/// The minWidth is the minimum width of the menu.
this.minWidth,
/// The borderRadius is the border radius of the menu.
this.borderRadius,
/// The dividerColor is the color of the divider.
this.dividerColor,
/// The dividerHeight is the height of the divider.
this.dividerHeight = 1.0,
/// The tapType is the type of tap that will open the menu.
this.tapType = GrockMenuTapType.onTap,
/// The textStyle is the text style of the menu item.
this.textStyle,
/// The backgroundColor is the background color of the menu.
this.backgroundColor,
/// The border is the border of the menu.
this.border,
/// The pressColor is the color of the menu item when it is pressed.
this.pressColor = Colors.white,
/// The maxLines is the maximum number of lines of the menu item.
this.maxLines,
/// The textAlign is the text alignment of the menu item.
this.textAlign,
/// The textOverflow is the text overflow of the menu item.
this.textOverflow = TextOverflow.ellipsis,
/// The padding is the padding of the menu item.
this.padding,
/// The onTapClose is the boolean that will be used to determine whether the menu will close when the menu item is tapped.
this.onTapClose = true,
/// The spaceColor is the color of the space between the menu and the menu item.
this.spaceColor = Colors.black26,
/// The openAnimationDuration is the duration of the open animation.
this.openAnimationDuration = const Duration(milliseconds: 300),
/// The closeAnimationDuration is the duration of the close animation.
this.closeAnimationDuration = const Duration(milliseconds: 250),
/// The openAnimation is the open animation.
this.openAnimation = Curves.fastOutSlowIn,
/// The closeAnimation is the close animation.
this.closeAnimation = Curves.linear,
/// The openAlignment is the alignment of the menu when it is open.
this.openAlignment,
/// The backgroundBlur is the blur of the background when the menu is open.
this.backgroundBlur = 40.0,
/// The spaceBlur is the blur of the space between the menu and the menu item.
this.spaceBlur = 1.0,
/// The leftSpace is the left space between the menu and the menu item.
this.leftSpace,
/// The rightSpace is the right space between the menu and the menu item.
this.rightSpace,
/// The topSpace is the top space between the menu and the menu item.
this.topSpace,
/// The bottomSpace is the bottom space between the menu and the menu item.
this.bottomSpace,
/// The startTween is the start tween of the menu item.
this.tween,
/// The backgroundDecoration is the decoration of the background when the menu is open.
this.backgroundDecoration,
/// The divider is the divider between the menu items.
this.divider,
/// The isTopSpace is the boolean that will be used to determine whether the top space will be displayed.
this.isTopSpace = false,
/// The isLeftSpace is the boolean that will be used to determine whether the left space will be displayed.
this.isLeftSpace = false,
/// GrockMenuAnimationType is the animation type of the menu.
this.animationType = GrockMenuAnimationType.none,
/// The slideTween is the slide tween of the menu.
this.slideTween,
}) : super(key: key);