I try to get a list of all fields - only they one which are not hidden - from QqsVectorLayer in QGIS 3 using python API. In QGIS 2 I used to do it like that:
conf = layer.editFormConfig()
for field in layer.fields():
if conf.widgetType(field.name()) != 'Hidden':
print(field.alias())
What's the proper way to do that in QGIS 3?