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 {
/// The [clipBehavior] argument must not be null or [Clip.none].
const ClipRRect({
Key key,
this.borderRadius,
this.borderRadius = BorderRadius.zero,
this.clipper,
this.clipBehavior = Clip.antiAlias,
Widget child,
......
......@@ -92,6 +92,12 @@ void main() {
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 {
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