“Flutter PopupMenubutton” Code-Antworten

Flutter PopupMenubutton

PopupMenuButton(
        itemBuilder: (BuildContext context) => <PopupMenuEntry>[
          const PopupMenuItem(
            child: Text('Option1'),
          ),
          const PopupMenuItem(
            child: Text('Option2'),
          ),
          const PopupMenuItem(
            child: Text('Option3'),
          ),
        ],
      )
Sore Serval

So fügen Sie PopupMenubutton in Flattern hinzu

//with tooltip and round border corner(if you also needed those)
actions: [
          PopupMenuButton<int>(
            tooltip: "",                           //Adding tooltip
            shape: RoundedRectangleBorder(         //Adding Round Border
              borderRadius: BorderRadius.all(
                Radius.circular(20.0),
              ),
            ),
            itemBuilder: (context) => [
              PopupMenuItem(
                child: Text("Settings"),
                value: 1,
              ),
              PopupMenuDivider(                    //Adding Divider
                height: 0, 
              ),
              PopupMenuItem(
                child: Text("FAQ"),
                value: 2,
              ),
              PopupMenuDivider(                    //Adding Divider
                height: 0,
              ),
              PopupMenuItem(
                child: Text("Contact Us"),
                value: 2,
              ),
            ],
          ),
          SizedBox(width: 10),
        ],
Magnificent Moose

Ähnliche Antworten wie “Flutter PopupMenubutton”

Fragen ähnlich wie “Flutter PopupMenubutton”

Weitere verwandte Antworten zu “Flutter PopupMenubutton” auf Dart

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen