Remove clipBehavior == Clip.none
conditions (#98503)
This commit is contained in:
parent
0ed7fc88fa
commit
c504797c42
@ -293,13 +293,11 @@ class CupertinoFormSection extends StatelessWidget {
|
||||
),
|
||||
Padding(
|
||||
padding: margin,
|
||||
child: clipBehavior == Clip.none
|
||||
? decoratedChildrenGroup
|
||||
: ClipRRect(
|
||||
borderRadius: childrenGroupBorderRadius,
|
||||
clipBehavior: clipBehavior,
|
||||
child: decoratedChildrenGroup,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: childrenGroupBorderRadius,
|
||||
clipBehavior: clipBehavior,
|
||||
child: decoratedChildrenGroup,
|
||||
),
|
||||
),
|
||||
if (footer != null)
|
||||
Align(
|
||||
|
@ -450,9 +450,6 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
|
||||
shape: shape,
|
||||
child: contents,
|
||||
);
|
||||
if (clipBehavior == Clip.none) {
|
||||
return child;
|
||||
}
|
||||
return ClipPath(
|
||||
clipper: ShapeBorderClipper(
|
||||
shape: shape,
|
||||
|
@ -1103,14 +1103,10 @@ class _InteractiveViewerBuilt extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
if (clipBehavior != Clip.none) {
|
||||
child = ClipRect(
|
||||
clipBehavior: clipBehavior,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
return child;
|
||||
return ClipRect(
|
||||
clipBehavior: clipBehavior,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
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() {
|
||||
),
|
||||
);
|
||||
|
||||
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 {
|
||||
|
@ -6,6 +6,7 @@ import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:vector_math/vector_math_64.dart' show Quad, Vector3, Matrix4;
|
||||
|
||||
@ -1168,10 +1169,8 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
expect(
|
||||
find.byType(ClipRect),
|
||||
findsNothing,
|
||||
);
|
||||
final RenderClipRect renderClip = tester.allRenderObjects.whereType<RenderClipRect>().first;
|
||||
expect(renderClip.clipBehavior, equals(Clip.none));
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
|
Loading…
x
Reference in New Issue
Block a user