defaultEntityMenuItems method

Iterable<MenuItem> defaultEntityMenuItems(
  1. BuildContext context,
  2. List<VEntity> entities
)

Implementation

Iterable<MenuItem> defaultEntityMenuItems(
    BuildContext context, List<VEntity> entities) sync* {
  if (entities.length == 1) {
    yield MenuButton(
      leading: Icon(Icons.pencil),
      onPressed: (_) => renameDialog(context, entities.first),
      child: Text("Rename"),
    );
  }

  yield MenuButton(
      leading: Icon(Icons.trash),
      onPressed: (_) => deleteDialog(context, entities),
      child: Text("Delete"));
}