Its happening right at my MenuAnchor:
The relevant error-causing widget was:
MenuAnchor MenuAnchor
I've seen this error many times, usually means that a height or width is missing. I tried wrapping my MenuAnchor with a SizedBox with a height and width and I tried wrapping the menuChildren with a SizedBox with a height and width and neither fixes the issue. The MenuAnchor is inside of a Column.
Widget build(BuildContext context) {
return ValueListenableBuilder(
valueListenable: controller,
builder: (context, selectedKeys, child) {
return MenuAnchor(
controller: controller.menuController,
alignmentOffset: const Offset(10, 5),
style: MenuStyle(
shape: const WidgetStatePropertyAll(LinearBorder()),
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
maximumSize: WidgetStatePropertyAll(Size.fromHeight(MediaQuery.of(context).size.height - kToolbarHeight - MediaQuery.of(context).padding.vertical)),
),
key: key,
menuChildren: [
...options.map<Widget>(
(option) => _DropdownItem<T>(
selected: controller.isSelected(option.key),
itemKey: option.key,
title: option.title,
onChanged: (key) {
controller.toggle(key);
onChanged(controller.value);
},
showCheckbox: showCheckbox,
),
),