CNPopupMenuButton.icon constructor

CNPopupMenuButton.icon({
  1. Key? key,
  2. CNSymbol? buttonIcon,
  3. IconData? buttonCustomIcon,
  4. CNImageAsset? buttonImageAsset,
  5. required List<CNPopupMenuEntry> items,
  6. required ValueChanged<int> onSelected,
  7. Color? tint,
  8. double size = 44.0,
  9. CNButtonStyle buttonStyle = CNButtonStyle.glass,
})

Creates a round, icon-only popup menu button.

Implementation

CNPopupMenuButton.icon({
  super.key,
  this.buttonIcon,
  this.buttonCustomIcon,
  this.buttonImageAsset,
  required this.items,
  required this.onSelected,
  this.tint,
  double size = 44.0, // button diameter (width = height)
  this.buttonStyle = CNButtonStyle.glass,
}) : buttonLabel = null,
     round = true,
     width = size,
     height = size,
     shrinkWrap = false,
     super() {
  assert(
    buttonIcon != null ||
        buttonCustomIcon != null ||
        buttonImageAsset != null,
    'At least one of buttonIcon, buttonCustomIcon, or buttonImageAsset must be provided',
  );
}