CircularMenu constructor
CircularMenu({
- required List<
CircularMenuItem> items, - AlignmentGeometry alignment = Alignment.bottomCenter,
- double radius = 100,
- Widget? backgroundWidget,
- Duration animationDuration = const Duration(milliseconds: 500),
- Curve curve = Curves.bounceOut,
- Curve reverseCurve = Curves.fastOutSlowIn,
- VoidCallback? toggleButtonOnPressed,
- Color? toggleButtonColor,
- List<
BoxShadow> ? toggleButtonBoxShadow, - double toggleButtonMargin = 10,
- double toggleButtonPadding = 10,
- double toggleButtonSize = 40,
- Color? toggleButtonIconColor,
- AnimatedIconData toggleButtonAnimatedIconData = AnimatedIcons.menu_close,
- GlobalKey<
CircularMenuState> ? key, - double? startingAngleInRadian,
- double? endingAngleInRadian,
creates a circular menu with specific radius and alignment .
toggleButtonElevation
,toggleButtonPadding and toggleButtonMargin must be
equal or greater than zero.
items must not be null and it must contains two elements at least.
Implementation
CircularMenu({
required this.items,
this.alignment = Alignment.bottomCenter,
this.radius = 100,
this.backgroundWidget,
this.animationDuration = const Duration(milliseconds: 500),
this.curve = Curves.bounceOut,
this.reverseCurve = Curves.fastOutSlowIn,
this.toggleButtonOnPressed,
this.toggleButtonColor,
this.toggleButtonBoxShadow,
this.toggleButtonMargin = 10,
this.toggleButtonPadding = 10,
this.toggleButtonSize = 40,
this.toggleButtonIconColor,
this.toggleButtonAnimatedIconData = AnimatedIcons.menu_close,
this.key,
this.startingAngleInRadian,
this.endingAngleInRadian,
}) : assert(items.isNotEmpty, 'items can not be empty list'),
assert(items.length > 1, 'if you have one item no need to use a Menu'),
super(key: key);