Unverified Commit c504797c authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

Remove `clipBehavior == Clip.none` conditions (#98503)

parent 0ed7fc88
...@@ -293,13 +293,11 @@ class CupertinoFormSection extends StatelessWidget { ...@@ -293,13 +293,11 @@ class CupertinoFormSection extends StatelessWidget {
), ),
Padding( Padding(
padding: margin, padding: margin,
child: clipBehavior == Clip.none child: ClipRRect(
? decoratedChildrenGroup borderRadius: childrenGroupBorderRadius,
: ClipRRect( clipBehavior: clipBehavior,
borderRadius: childrenGroupBorderRadius, child: decoratedChildrenGroup,
clipBehavior: clipBehavior, ),
child: decoratedChildrenGroup,
),
), ),
if (footer != null) if (footer != null)
Align( Align(
......
...@@ -450,9 +450,6 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin { ...@@ -450,9 +450,6 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
shape: shape, shape: shape,
child: contents, child: contents,
); );
if (clipBehavior == Clip.none) {
return child;
}
return ClipPath( return ClipPath(
clipper: ShapeBorderClipper( clipper: ShapeBorderClipper(
shape: shape, shape: shape,
......
...@@ -1103,14 +1103,10 @@ class _InteractiveViewerBuilt extends StatelessWidget { ...@@ -1103,14 +1103,10 @@ class _InteractiveViewerBuilt extends StatelessWidget {
); );
} }
if (clipBehavior != Clip.none) { return ClipRect(
child = ClipRect( clipBehavior: clipBehavior,
clipBehavior: clipBehavior, child: child,
child: child, );
);
}
return child;
} }
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
...@@ -163,6 +164,7 @@ void main() { ...@@ -163,6 +164,7 @@ void main() {
), ),
); );
expect(find.byType(ClipRRect), findsNothing); final RenderClipRRect renderClip = tester.allRenderObjects.whereType<RenderClipRRect>().first;
expect(renderClip.clipBehavior, equals(Clip.none));
}); });
} }
...@@ -420,7 +420,8 @@ void main() { ...@@ -420,7 +420,8 @@ void main() {
), ),
); );
expect(find.byKey(materialKey), hasNoImmediateClip); final RenderClipPath renderClip = tester.allRenderObjects.whereType<RenderClipPath>().first;
expect(renderClip.clipBehavior, equals(Clip.none));
}); });
testWidgets('clips to bounding rect by default given Clip.antiAlias', (WidgetTester tester) async { testWidgets('clips to bounding rect by default given Clip.antiAlias', (WidgetTester tester) async {
......
...@@ -6,6 +6,7 @@ import 'dart:math' as math; ...@@ -6,6 +6,7 @@ import 'dart:math' as math;
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:vector_math/vector_math_64.dart' show Quad, Vector3, Matrix4; import 'package:vector_math/vector_math_64.dart' show Quad, Vector3, Matrix4;
...@@ -1168,10 +1169,8 @@ void main() { ...@@ -1168,10 +1169,8 @@ void main() {
), ),
); );
expect( final RenderClipRect renderClip = tester.allRenderObjects.whereType<RenderClipRect>().first;
find.byType(ClipRect), expect(renderClip.clipBehavior, equals(Clip.none));
findsNothing,
);
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
......
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