This is my widget
Widget sortingWidget() {
return new PopupMenuButton<int>(
itemBuilder: (context) => [
PopupMenuItem(
value : this._popMenuBtn,
child: SwitchListTile(
title: const Text('Sort by experience'),
value: this._sortByExperienceSwitch,
onChanged: handleExperienceSortingToggle,
),
)
],
);
}
And this is my toggle handle function
handleExperienceSortingToggle(value) {
this.setState(() {
this._sortByExperienceSwitch = value;
}
);
}
But when I change state it is not changing and only changes when the popup-menu button is closed and open