import 'package:flutter/material.dart';

class CustomPopupMenuEntry extends PopupMenuEntry<int> {
  final Widget child;

  CustomPopupMenuEntry({required this.child});

  @override
  double get height => 0; // 0 because height depends on child

  @override
  bool represents(int? value) => false;

  @override
  State<StatefulWidget> createState() => _CustomPopupMenuEntryState();
}

class _CustomPopupMenuEntryState extends State<CustomPopupMenuEntry> {
  @override
  Widget build(BuildContext context) {
    return IntrinsicHeight(
      // <-- wrap with IntrinsicHeight
      child: widget.child,
    );
  }
}
