-
Taha Tesser authored
Fix `SearchAnchor`'s search view isn't updated when the theme changes & widgets inside the search view do not inherit local themes (#132749) fixes [SearchAnchor (search view) UI glitch on platform brightness changes](https://github.com/flutter/flutter/issues/131835) fixes [Search view widgets cannot inherit local themes](https://github.com/flutter/flutter/issues/132741) ### Description - This fixes an issue where the `SearchAnchor`'s search view isn't updated when the platform brightness changes. - Fixes an issue where widgets inside the search view cannot use local themes ### Actual Results `SearchAnchor` currently passed both global and local themes on the search view popup pushing and it uses anchor. button's context to look up the theme.  As a result, when the platform changes and the search view is rebuilt, it cannot use the updated theme. https://github.com/flutter/flutter/assets/48603081/2f1ebe74-e7d5-4ef3-b97c-a741c3d68964 ### Expected Results Similar to `PopupMenuButton`, the theme should be located in the search view so that when the platform brightness is updated and the search view is rebuilt it can use the updated theme.  https://github.com/flutter/flutter/assets/48603081/d8d85982-c661-4cac-83e8-0488b1d93daf However, the search view's context cannot access local themes so I added support for `InheritedTheme`, which fixes the local. theme issue for both the search view and widgets inside the search view. ### When using local themes for the `SearchAnchor`'s search view and widgets inside the view. ### Before  ### After 