【flutter】左上角弹出框

String gridName ='sssssss'
actions: [
          Builder(
            builder: (context){
              return PopupMenuButton(
                  child: Container(
                    margin: EdgeInsets.fromLTRB(0, 0, 10, 0),
                    child: Center(
                      child: Text(gridName ,overflow: TextOverflow.ellipsis,),
                    ),
                  ),
                  itemBuilder: (BuildContext context) => >[
                    PopupMenuItem(
                        value: 'id01', child: Text('name One')),
                    PopupMenuItem(
                        value: 'id02', child: Text('name Two')),
                    PopupMenuItem(
                        value: 'id03', child: Text('name Three')),
                    PopupMenuItem(
                        value: 'id04', child: Text('nameFour'))
                  ],
                  onSelected: (String value) {
                    setState(() { gridName = value; });
                  });
            },
          ),
        ],

你可能感兴趣的:(【flutter】左上角弹出框)