I have one filtering dropdown. I have one button on another page. When I click this button on another page, how can I return to other options of the dropdown on the other page?
DropdownPage
CustomDropdownButton<bool>(
hintText: "Select Filter",
value: controller.selectedFilter.value,
items: [
DropdownMenuItem<bool>(
child: Text("Sales"),
value: true,
),
DropdownMenuItem<bool>(
child: Text("Refunds"),
value: false,
)
],
onChanged: (bool selectedFilter) {
controller.selectedFilter.value = selectedFilter;
},
)
Otherpage (button is here, this dropdown on another page)
Expanded(
child: ElevatedButton(
onPressed: () {
// return dropdown other value (this dropdown on another page).
},
child: Text("Update")),
)
Thank you,