Adds validate method to NestedWidgets.