I don't want to use CheckedPopupMenuItem because my aim is to have a Checkbox for user to interact with. But even calling setState in the CheckBoxListTile in PopupMenuButton it does not rebuild when we tap on it.
Here is the code:
PopupMenuButton(
offset: Offset(100, 100),
elevation: 5.0,
child: _menuIcon,
itemBuilder: (context) => [
PopupMenuItem(
child: CheckBoxListTile(
activeColor: kLeadingOrangeColor,
value: isShow,
onChanged: (value) =>
setState(() => isShow = value),
title: checkboxLabel('Show'),
),
),
],
)
Every time I clicked it, it seems nothing happens although I call setState. So for me to see the change from "checked" mark to "unchecked" mark and vice versa, I had to close and reopen the PopupMenuButton.