Skip to content

Add more 0x0 size tests part 9#185625

Merged
auto-submit[bot] merged 12 commits into
flutter:masterfrom
ahmedsameha1:add_more_0x0_size_tests_part_9
Apr 29, 2026
Merged

Add more 0x0 size tests part 9#185625
auto-submit[bot] merged 12 commits into
flutter:masterfrom
ahmedsameha1:add_more_0x0_size_tests_part_9

Conversation

@ahmedsameha1
Copy link
Copy Markdown
Contributor

This is my attempt to handle #6537 for the following widgets:
Transform
PhysicalShape
PhysicalModel
ClipPath
ClipOval
ClipRSuperellipse
ClipRRect
ClipRect
CustomPaint
BackdropFilter

@github-actions github-actions Bot added the framework flutter/packages/flutter repository. See also f: labels. label Apr 27, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds regression tests for BackdropFilter, Clip widgets, CustomPaint, PhysicalModel, PhysicalShape, and Transform to ensure they do not crash when rendered with zero area. Feedback suggests simplifying the ClipRect test and removing unused ValueNotifier variables and disposal logic in several clipping tests to improve consistency and remove redundant code.

Comment on lines +919 to +929
final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0));
addTearDown(tester.view.reset);
addTearDown(clip.dispose);
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: ClipRect(clipper: NotifyClipper<Rect>(clip: clip)),
),
),
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This test can be simplified by removing the ValueNotifier and the custom clipper, as they are not necessary to verify that the widget does not crash at zero area. This also makes the test consistent with the others in this file.

    addTearDown(tester.view.reset);
    await tester.pumpWidget(
      const Directionality(
        textDirection: TextDirection.ltr,
        child: Center(
          child: ClipRect(child: Placeholder()),
        ),
      ),
    );
References
  1. Suggest simplification and refactoring: Assess whether the code can be made simpler or refactored to enhance readability and maintainability. (link)
  2. Write what you need and no more, but when you write it, do it right. (link)

Comment on lines +935 to +937
final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0));
addTearDown(tester.view.reset);
addTearDown(clip.dispose);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The clip variable and its disposal are unused in this test. They appear to be leftovers from a copy-paste of the ClipRect test.

    addTearDown(tester.view.reset);
References
  1. Write what you need and no more, but when you write it, do it right. (link)

Comment on lines +951 to +953
final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0));
addTearDown(tester.view.reset);
addTearDown(clip.dispose);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The clip variable and its disposal are unused in this test.

    addTearDown(tester.view.reset);
References
  1. Write what you need and no more, but when you write it, do it right. (link)

Comment on lines +970 to +972
final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0));
addTearDown(tester.view.reset);
addTearDown(clip.dispose);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The clip variable and its disposal are unused in this test.

    addTearDown(tester.view.reset);
References
  1. Write what you need and no more, but when you write it, do it right. (link)

Comment on lines +984 to +986
final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0));
addTearDown(tester.view.reset);
addTearDown(clip.dispose);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The clip variable and its disposal are unused in this test.

    addTearDown(tester.view.reset);
References
  1. Write what you need and no more, but when you write it, do it right. (link)

@victorsanni victorsanni requested a review from dkwingsmt April 27, 2026 23:53
Copy link
Copy Markdown
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@dkwingsmt dkwingsmt added autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD labels Apr 28, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 28, 2026
@auto-submit
Copy link
Copy Markdown
Contributor

auto-submit Bot commented Apr 28, 2026

autosubmit label was removed for flutter/flutter/185625, because - The status or check suite Mac framework_tests_impeller has failed. Please fix the issues identified (or deflake) before re-applying this label.

@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 28, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 28, 2026
@dkwingsmt dkwingsmt added the CICD Run CI/CD label Apr 28, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 28, 2026
Merged via the queue into flutter:master with commit ab60883 Apr 29, 2026
88 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants