CircularMenu constructor

CircularMenu({
  1. required List<CircularMenuItem> items,
  2. AlignmentGeometry alignment = Alignment.bottomCenter,
  3. double radius = 100,
  4. Widget? backgroundWidget,
  5. Duration animationDuration = const Duration(milliseconds: 500),
  6. Curve curve = Curves.bounceOut,
  7. Curve reverseCurve = Curves.fastOutSlowIn,
  8. VoidCallback? toggleButtonOnPressed,
  9. Color? toggleButtonColor,
  10. List<BoxShadow>? toggleButtonBoxShadow,
  11. double toggleButtonMargin = 10,
  12. double toggleButtonPadding = 10,
  13. double toggleButtonSize = 40,
  14. Color? toggleButtonIconColor,
  15. AnimatedIconData toggleButtonAnimatedIconData = AnimatedIcons.menu_close,
  16. GlobalKey<CircularMenuState>? key,
  17. double? startingAngleInRadian,
  18. 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);