How to change popup background color in flutter

Issue

I’ve created this popup menu in my project and I’m trying to change the the background color of the popup menu but not really sure how I ca change it so I would be really appreciated if I can get any help or suggestion.

                      ? PopupMenuButton(
                          icon: Icon(
                            Icons.more_vert,
                            color: Colors.white,
                          ),
                          onSelected: selectedOption,
                          itemBuilder: (BuildContext context) {
                            return Popup.choises.map((String value) {
                              return PopupMenuItem<String>(
                                value: value,
                                child: Text(value),
                              );
                            }).toList();
                          })

enter image description here

Solution

Use this

PopupMenuButton(
           color: Colors.white,
                              icon: Icon(
                                Icons.more_vert,
                                color: Colors.white,
                              ),
                              onSelected: selectedOption,
                              itemBuilder: (BuildContext context) {
                                return Popup.choises.map((String value) {
                                  return PopupMenuItem<String>(
                                    value: value,
                                    child: Text(value),
                                  );
                                }).toList();
                              })

Answered By – Tasnuva Tavasum oshin

Answer Checked By – Robin (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *