Commit bcab851b authored by Stefano Rodriguez's avatar Stefano Rodriguez Committed by Jonah Williams

Set default borderRadius to zero in ClipRRect (as documented) (#43006)

* Set default borderRadius to none in ClipRRect

* add tests
parent 4f385c8f
...@@ -647,7 +647,7 @@ class ClipRRect extends SingleChildRenderObjectWidget { ...@@ -647,7 +647,7 @@ class ClipRRect extends SingleChildRenderObjectWidget {
/// The [clipBehavior] argument must not be null or [Clip.none]. /// The [clipBehavior] argument must not be null or [Clip.none].
const ClipRRect({ const ClipRRect({
Key key, Key key,
this.borderRadius, this.borderRadius = BorderRadius.zero,
this.clipper, this.clipper,
this.clipBehavior = Clip.antiAlias, this.clipBehavior = Clip.antiAlias,
Widget child, Widget child,
......
...@@ -92,6 +92,12 @@ void main() { ...@@ -92,6 +92,12 @@ void main() {
expect(renderClip.clipBehavior, equals(Clip.hardEdge)); expect(renderClip.clipBehavior, equals(Clip.hardEdge));
}); });
test('ClipRRect constructs with the right default values', () {
const ClipRRect clipRRect = ClipRRect();
expect(clipRRect.clipBehavior, equals(Clip.antiAlias));
expect(clipRRect.borderRadius, equals(BorderRadius.zero));
});
testWidgets('ClipRRect updates clipBehavior in updateRenderObject', (WidgetTester tester) async { testWidgets('ClipRRect updates clipBehavior in updateRenderObject', (WidgetTester tester) async {
await tester.pumpWidget(_UpdateCountedClipRRect()); await tester.pumpWidget(_UpdateCountedClipRRect());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment