When I use a Web Map from ArcGIS Online then this does work for me.
Stan, I am not sure why yours is not working but it should.
However, I am testing out the Local Layer Widget so my layers are coming from my ArcGIS Server not AGOL.
As far as I can tell there currently seems to be no way to exclude layers from the Legend when using Local Layers.
If anyone has any suggestions that would be greatly appreciated.
My layers are coming from our ArgGIS Server to AGOL and being used in WAB Developers edition.
If I go into the AGOL web map and hide the layer in the legend(as mentioned above), but still have the layer turned on then in WAB when the layer is turned on it shows up in the legend. To me it seems that WAB does not respect the setting in AGOL to hide items in the legend.
I do not find the same issue. When in AGOL I can go to one of my web maps and choose hide in legend and it does not appear in the Legend Widget in WAB.
OK I looked at it some more and found that it only happens when I hide only a sub layer in a group. When I hide the top layer in the group it works as expected.
Here is a screen shot. When I hide the TOP layer it hides all. When I hide only the buffer layer then WAB does not respect that.