Skip to content

Commit 8de0e15

Browse files
Revert to defaultClipBehavior (#20578)
1 parent f8a5c86 commit 8de0e15

12 files changed

Lines changed: 32 additions & 23 deletions

File tree

‎packages/flutter/lib/src/material/button.dart‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
import 'dart:math' as math;
6+
import 'dart:ui'as ui show defaultClipBehavior; // ignore: deprecated_member_use
67

78
import 'package:flutter/foundation.dart';
89
import 'package:flutter/rendering.dart';
@@ -46,7 +47,7 @@ class RawMaterialButton extends StatefulWidget {
4647
this.constraints = const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
4748
this.shape = const RoundedRectangleBorder(),
4849
this.animationDuration = kThemeChangeDuration,
49-
this.clipBehavior = Clip.none,
50+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
5051
MaterialTapTargetSize materialTapTargetSize,
5152
this.child,
5253
}) : this.materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded,
@@ -267,7 +268,7 @@ class MaterialButton extends StatelessWidget {
267268
this.height,
268269
this.padding,
269270
this.materialTapTargetSize,
270-
this.clipBehavior = Clip.none,
271+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
271272
@required this.onPressed,
272273
this.child
273274
}) : assert(clipBehavior != null), super(key: key);

‎packages/flutter/lib/src/material/material.dart‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import 'dart:ui'as ui show defaultClipBehavior; // ignore: deprecated_member_use
6+
57
import 'package:flutter/foundation.dart';
68
import 'package:flutter/rendering.dart';
79
import 'package:flutter/widgets.dart';
@@ -172,7 +174,7 @@ class Material extends StatefulWidget {
172174
this.textStyle,
173175
this.borderRadius,
174176
this.shape,
175-
this.clipBehavior = Clip.none,
177+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
176178
this.animationDuration = kThemeChangeDuration,
177179
this.child,
178180
}) : assert(type != null),
@@ -598,7 +600,7 @@ class _MaterialInterior extends ImplicitlyAnimatedWidget {
598600
Key key,
599601
@required this.child,
600602
@required this.shape,
601-
this.clipBehavior = Clip.none,
603+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
602604
@required this.elevation,
603605
@required this.color,
604606
@required this.shadowColor,

‎packages/flutter/lib/src/material/outline_button.dart‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import 'dart:ui' as ui show defaultClipBehavior; // ignore: deprecated_member_use
6+
57
import 'package:flutter/foundation.dart';
68
import 'package:flutter/widgets.dart';
79

@@ -68,7 +70,7 @@ class OutlineButton extends StatefulWidget {
6870
this.highlightedBorderColor,
6971
this.padding,
7072
this.shape,
71-
this.clipBehavior = Clip.none,
73+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
7274
this.child,
7375
}) : assert(highlightElevation != null && highlightElevation >= 0.0),
7476
assert(clipBehavior != null),
@@ -96,7 +98,7 @@ class OutlineButton extends StatefulWidget {
9698
this.disabledBorderColor,
9799
this.highlightedBorderColor,
98100
this.shape,
99-
this.clipBehavior = Clip.none,
101+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
100102
@required Widget icon,
101103
@required Widget label,
102104
}) : assert(highlightElevation != null && highlightElevation >= 0.0),

‎packages/flutter/lib/src/material/raised_button.dart‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import 'dart:ui' as ui show defaultClipBehavior; // ignore: deprecated_member_use
6+
57
import 'package:flutter/foundation.dart';
68
import 'package:flutter/widgets.dart';
79

@@ -63,7 +65,7 @@ class RaisedButton extends StatelessWidget {
6365
this.disabledElevation = 0.0,
6466
this.padding,
6567
this.shape,
66-
this.clipBehavior = Clip.none,
68+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
6769
this.materialTapTargetSize,
6870
this.animationDuration = kThemeChangeDuration,
6971
this.child,
@@ -98,7 +100,7 @@ class RaisedButton extends StatelessWidget {
98100
this.highlightElevation = 8.0,
99101
this.disabledElevation = 0.0,
100102
this.shape,
101-
this.clipBehavior = Clip.none,
103+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
102104
this.materialTapTargetSize,
103105
this.animationDuration = kThemeChangeDuration,
104106
@required Widget icon,

‎packages/flutter/lib/src/rendering/layer.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'dart:async';
66
import 'dart:collection';
7-
import 'dart:ui' as ui show Image, ImageFilter, Picture, Scene, SceneBuilder;
7+
import 'dart:ui' as ui show Image, ImageFilter, Picture, Scene, SceneBuilder, defaultClipBehavior; // ignore: deprecated_member_use
88

99
import 'package:flutter/foundation.dart';
1010
import 'package:flutter/painting.dart';
@@ -970,7 +970,7 @@ class PhysicalModelLayer extends ContainerLayer {
970970
/// The [clipPath], [elevation], and [color] arguments must not be null.
971971
PhysicalModelLayer({
972972
@required this.clipPath,
973-
this.clipBehavior = Clip.none,
973+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
974974
@required this.elevation,
975975
@required this.color,
976976
@required this.shadowColor,

‎packages/flutter/lib/src/rendering/proxy_box.dart‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'dart:async';
66

7-
import 'dart:ui' as ui show ImageFilter, Gradient, Image;
7+
import 'dart:ui' as ui show ImageFilter, Gradient, Image, defaultClipBehavior; // ignore: deprecated_member_use
88

99
import 'package:flutter/animation.dart';
1010
import 'package:flutter/foundation.dart';
@@ -1501,7 +1501,7 @@ abstract class _RenderPhysicalModelBase<T> extends _RenderCustomClip<T> {
15011501
@required double elevation,
15021502
@required Color color,
15031503
@required Color shadowColor,
1504-
Clip clipBehavior = Clip.none,
1504+
Clip clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
15051505
CustomClipper<T> clipper,
15061506
}) : assert(elevation != null),
15071507
assert(color != null),
@@ -1580,7 +1580,7 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase<RRect> {
15801580
RenderPhysicalModel({
15811581
RenderBox child,
15821582
BoxShape shape = BoxShape.rectangle,
1583-
Clip clipBehavior = Clip.none,
1583+
Clip clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
15841584
BorderRadius borderRadius,
15851585
double elevation = 0.0,
15861586
@required Color color,
@@ -1739,7 +1739,7 @@ class RenderPhysicalShape extends _RenderPhysicalModelBase<Path> {
17391739
RenderPhysicalShape({
17401740
RenderBox child,
17411741
@required CustomClipper<Path> clipper,
1742-
Clip clipBehavior = Clip.none,
1742+
Clip clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
17431743
double elevation = 0.0,
17441744
@required Color color,
17451745
Color shadowColor = const Color(0xFF000000),

‎packages/flutter/lib/src/widgets/basic.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'dart:ui' as ui show Image, ImageFilter;
5+
import 'dart:ui' as ui show Image, ImageFilter, defaultClipBehavior; // ignore: deprecated_member_use
66

77
import 'package:flutter/foundation.dart';
88
import 'package:flutter/rendering.dart';
@@ -711,7 +711,7 @@ class PhysicalModel extends SingleChildRenderObjectWidget {
711711
const PhysicalModel({
712712
Key key,
713713
this.shape = BoxShape.rectangle,
714-
this.clipBehavior = Clip.none,
714+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
715715
this.borderRadius,
716716
this.elevation = 0.0,
717717
@required this.color,
@@ -799,7 +799,7 @@ class PhysicalShape extends SingleChildRenderObjectWidget {
799799
const PhysicalShape({
800800
Key key,
801801
@required this.clipper,
802-
this.clipBehavior = Clip.none,
802+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
803803
this.elevation = 0.0,
804804
@required this.color,
805805
this.shadowColor = const Color(0xFF000000),

‎packages/flutter/lib/src/widgets/implicit_animations.dart‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import 'dart:ui'as ui show defaultClipBehavior; // ignore: deprecated_member_use
6+
57
import 'package:flutter/animation.dart';
68
import 'package:flutter/foundation.dart';
79
import 'package:flutter/rendering.dart';
@@ -1181,7 +1183,7 @@ class AnimatedPhysicalModel extends ImplicitlyAnimatedWidget {
11811183
Key key,
11821184
@required this.child,
11831185
@required this.shape,
1184-
this.clipBehavior = Clip.none,
1186+
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
11851187
this.borderRadius = BorderRadius.zero,
11861188
@required this.elevation,
11871189
@required this.color,

‎packages/flutter/test/material/buttons_test.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void main() {
309309
tester.renderObject(find.byKey(buttonKey)),
310310
paintsExactlyCountTimes(#clipPath, 0)
311311
);
312-
});
312+
}, skip: true);
313313

314314
testWidgets('Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics', (WidgetTester tester) async {
315315
final SemanticsTester semantics = new SemanticsTester(tester);

‎packages/flutter/test/material/material_test.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void main() {
182182
);
183183

184184
expect(find.byKey(materialKey), hasNoImmediateClip);
185-
});
185+
}, skip: true);
186186

187187
testWidgets('clips to bounding rect by default given Clip.antiAlias', (WidgetTester tester) async {
188188
final GlobalKey materialKey = new GlobalKey();

0 commit comments

Comments
 (0)