Ben Konyi b74475af9d
[ Widget Preview ] Fix crash when @Preview annotations appeared outside of lib/ (#180768)
The widget preview scaffold requires that previews are defined within
importable libraries. Since Dart does not support absolute paths for
imports or relative imports outside of the project, it's not possible
for the widget previewer to display previews defined outside of `lib/`.

This change updates the preview detector to ignore libraries that don't
have a package name (e.g., libraries under `test/`) and updates
`packageName` properties to not allow for null to make it clear that
package names are required for previews.

Fixes https://github.com/flutter/flutter/issues/178651
2026-01-19 17:57:10 +00:00
..