flutter popupmenubutton

90

PopupMenuButton(
        itemBuilder: (BuildContext context) => <PopupMenuEntry>[
          const PopupMenuItem(
            child: Text('Option1'),
          ),
          const PopupMenuItem(
            child: Text('Option2'),
          ),
          const PopupMenuItem(
            child: Text('Option3'),
          ),
        ],
      )
PopupMenuButton(
  child: Center(child: Text('click here')),
  itemBuilder: (context) {
    return List.generate(5, (index) {
      return PopupMenuItem(
        child: Text('button no $index'),
      );
    });
  },
),

Comments

Submit
0 Comments