Closed busslina closed 5 months ago
You can use Navigator.pop
You can use Navigator.pop
And what about if I want to open it programmatically too?
Seems to be needed a logic/controller to provide common operations on it that hides implementation like NavigatorPop
.
And what about if I want to open it programmatically too?
You can do:
final openDropdownListenable = ValueNotifier<Object?>(null);
@override
Widget build(BuildContext context) {
return Column(
children:[
DropdownButton2<String>(
// Other properties...
openDropdownListenable: openDropdownListenable,
);
// Open the dropdown programmatically, like when another button is pressed:
ElevatedButton(
onTap: () => openDropdownListenable.value = Object(),
),
],
);
}
@AhmedLSayed9 thanks!
Is it possible? I don't see any option like a controller or similar.
Thank you