Skip to content

Commit

Permalink
Make search view shape clip the view content (#125161)
Browse files Browse the repository at this point in the history
Fixes #124426

This PR is to make the search view shape clip the view content.

Before: the highlight and the "i" of "item 9" are not clipped by the shape.

<img width="350" alt="Screenshot 2023-04-19 at 12 09 48 PM" src="https://user-images.githubusercontent.com/36861262/233201222-468820a9-8717-4b6c-8528-8125a40fc161.png">

After:

<img width="350" alt="Screenshot 2023-04-19 at 2 13 52 PM" src="https://user-images.githubusercontent.com/36861262/233201609-81f5a942-2390-4081-a9c7-c9523a7f9e72.png">
  • Loading branch information
QuncCccccc authored Apr 20, 2023
1 parent 8ed26d8 commit 3315b25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/flutter/lib/src/material/search_anchor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ class _ViewContentState extends State<_ViewContent> {
width: _viewRect.width,
height: _viewRect.height,
child: Material(
clipBehavior: Clip.antiAlias,
shape: effectiveShape,
color: effectiveBackgroundColor,
surfaceTintColor: effectiveSurfaceTint,
Expand Down
1 change: 1 addition & 0 deletions packages/flutter/test/material/search_anchor_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ void main() {
expect(material.elevation, 6.0);
expect(material.color, colorScheme.surface);
expect(material.surfaceTintColor, colorScheme.surfaceTint);
expect(material.clipBehavior, Clip.antiAlias);

final Finder findDivider = find.byType(Divider);
final Container dividerContainer = tester.widget<Container>(find.descendant(of: findDivider, matching: find.byType(Container)).first);
Expand Down

0 comments on commit 3315b25

Please sign in to comment.