e655e9fd6c
Add `ClassBody.members` and `EnumBody.constants`/`members` so callers can access class and enum contents through the common body interfaces instead of pattern matching on `BlockClassBody` and `BlockEnumBody`. Implement empty node lists for empty class and enum bodies, update the public API, and migrate analyzer, analysis_server, analyzer_plugin, and linter code to use the new accessors directly. This removes the ad hoc `members2` helper extensions and a large amount of repeated `tryCast` and `switch` logic, making body traversal more uniform. Change-Id: I51d75f2253c7e6f75efecae84bf0443ff5eb6788 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488263 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Paul Berry <paulberry@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>