sourcePopupMenuRow function

Widget sourcePopupMenuRow({
  1. required Widget icon,
  2. required String label,
  3. TextStyle? textStyle,
  4. double iconSlotWidth = 22,
  5. double gap = 8,
})

Standard popup-menu row with a fixed-width prefix icon and ellipsized label.

Implementation

Widget sourcePopupMenuRow({
  required Widget icon,
  required String label,
  TextStyle? textStyle,
  double iconSlotWidth = 22,
  double gap = 8,
}) =>
    Row(
      mainAxisSize: MainAxisSize.min,
      children: [
        SizedBox(
          width: iconSlotWidth,
          child: Center(child: icon),
        ),
        SizedBox(width: gap),
        Flexible(
          child: Text(label, style: textStyle, overflow: TextOverflow.ellipsis),
        ),
      ],
    );