image description here
so how to create it? I tried to find out but still can’t find a way
2
You can simply use a dropdown widget and wrap it with visibility widget which will be updated on the basis of that button click:
bool visible=false; ElevatedButton(onPressed: (){ visible=!visible; //onPressing the click button it will update visible variable }, child: Text('Click')), Visibility( visible: visible, //which will make the dropdown visible child: DropdownButton(items: items, onChanged: (){}))
Make use of Visibility widget
bool isDropDownVisible = false Visibility( visible: isDropDownVisible, child: DropdownButton( // DropDown Code )
Now while onButtonClick set it as a below:
setState(() { isCheckSelected =! isCheckSelected; });
Click here to cancel reply.
2
Answers
You can simply use a dropdown widget and wrap it with visibility widget which will be updated on the basis of that button click:
Make use of Visibility widget
Now while onButtonClick set it as a below: