Set the default clip to Clip.none again. (#20752)
This reverts commit 8de0e15e4fdd3a1be8878394a7f8c8bda948e59b and updates the goldens versoin. This requires https://github.com/flutter/flutter/pull/20751 to land first.
This commit is contained in:
parent
3900d42bfa
commit
ce8ba6e8b3
@ -1 +1 @@
|
|||||||
cc98e28c974eea0bd9a8e24591857ae6b5479795
|
1a999092d10a22bc700214b257cd4890c5800078
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
import 'dart:ui'as ui show defaultClipBehavior; // ignore: deprecated_member_use
|
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
@ -47,7 +46,7 @@ class RawMaterialButton extends StatefulWidget {
|
|||||||
this.constraints = const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
|
this.constraints = const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
|
||||||
this.shape = const RoundedRectangleBorder(),
|
this.shape = const RoundedRectangleBorder(),
|
||||||
this.animationDuration = kThemeChangeDuration,
|
this.animationDuration = kThemeChangeDuration,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
this.clipBehavior = Clip.none,
|
||||||
MaterialTapTargetSize materialTapTargetSize,
|
MaterialTapTargetSize materialTapTargetSize,
|
||||||
this.child,
|
this.child,
|
||||||
}) : this.materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded,
|
}) : this.materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded,
|
||||||
@ -269,7 +268,7 @@ class MaterialButton extends StatelessWidget {
|
|||||||
this.height,
|
this.height,
|
||||||
this.padding,
|
this.padding,
|
||||||
this.materialTapTargetSize,
|
this.materialTapTargetSize,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
this.clipBehavior = Clip.none,
|
||||||
@required this.onPressed,
|
@required this.onPressed,
|
||||||
this.child
|
this.child
|
||||||
}) : assert(clipBehavior != null), super(key: key);
|
}) : assert(clipBehavior != null), super(key: key);
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:ui'as ui show defaultClipBehavior; // ignore: deprecated_member_use
|
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
@ -174,7 +172,7 @@ class Material extends StatefulWidget {
|
|||||||
this.textStyle,
|
this.textStyle,
|
||||||
this.borderRadius,
|
this.borderRadius,
|
||||||
this.shape,
|
this.shape,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
|
this.clipBehavior = Clip.none,
|
||||||
this.animationDuration = kThemeChangeDuration,
|
this.animationDuration = kThemeChangeDuration,
|
||||||
this.child,
|
this.child,
|
||||||
}) : assert(type != null),
|
}) : assert(type != null),
|
||||||
@ -600,7 +598,7 @@ class _MaterialInterior extends ImplicitlyAnimatedWidget {
|
|||||||
Key key,
|
Key key,
|
||||||
@required this.child,
|
@required this.child,
|
||||||
@required this.shape,
|
@required this.shape,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
|
this.clipBehavior = Clip.none,
|
||||||
@required this.elevation,
|
@required this.elevation,
|
||||||
@required this.color,
|
@required this.color,
|
||||||
@required this.shadowColor,
|
@required this.shadowColor,
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:ui' as ui show defaultClipBehavior; // ignore: deprecated_member_use
|
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
@ -70,7 +68,7 @@ class OutlineButton extends StatefulWidget {
|
|||||||
this.highlightedBorderColor,
|
this.highlightedBorderColor,
|
||||||
this.padding,
|
this.padding,
|
||||||
this.shape,
|
this.shape,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
this.clipBehavior = Clip.none,
|
||||||
this.child,
|
this.child,
|
||||||
}) : assert(highlightElevation != null && highlightElevation >= 0.0),
|
}) : assert(highlightElevation != null && highlightElevation >= 0.0),
|
||||||
assert(clipBehavior != null),
|
assert(clipBehavior != null),
|
||||||
@ -98,7 +96,7 @@ class OutlineButton extends StatefulWidget {
|
|||||||
this.disabledBorderColor,
|
this.disabledBorderColor,
|
||||||
this.highlightedBorderColor,
|
this.highlightedBorderColor,
|
||||||
this.shape,
|
this.shape,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
this.clipBehavior = Clip.none,
|
||||||
@required Widget icon,
|
@required Widget icon,
|
||||||
@required Widget label,
|
@required Widget label,
|
||||||
}) : assert(highlightElevation != null && highlightElevation >= 0.0),
|
}) : assert(highlightElevation != null && highlightElevation >= 0.0),
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:ui' as ui show defaultClipBehavior; // ignore: deprecated_member_use
|
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
@ -65,7 +63,7 @@ class RaisedButton extends StatelessWidget {
|
|||||||
this.disabledElevation = 0.0,
|
this.disabledElevation = 0.0,
|
||||||
this.padding,
|
this.padding,
|
||||||
this.shape,
|
this.shape,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
|
this.clipBehavior = Clip.none,
|
||||||
this.materialTapTargetSize,
|
this.materialTapTargetSize,
|
||||||
this.animationDuration = kThemeChangeDuration,
|
this.animationDuration = kThemeChangeDuration,
|
||||||
this.child,
|
this.child,
|
||||||
@ -100,7 +98,7 @@ class RaisedButton extends StatelessWidget {
|
|||||||
this.highlightElevation = 8.0,
|
this.highlightElevation = 8.0,
|
||||||
this.disabledElevation = 0.0,
|
this.disabledElevation = 0.0,
|
||||||
this.shape,
|
this.shape,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
|
this.clipBehavior = Clip.none,
|
||||||
this.materialTapTargetSize,
|
this.materialTapTargetSize,
|
||||||
this.animationDuration = kThemeChangeDuration,
|
this.animationDuration = kThemeChangeDuration,
|
||||||
@required Widget icon,
|
@required Widget icon,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
import 'dart:ui' as ui show Image, ImageFilter, Picture, Scene, SceneBuilder, defaultClipBehavior; // ignore: deprecated_member_use
|
import 'dart:ui' as ui show Image, ImageFilter, Picture, Scene, SceneBuilder;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
@ -970,7 +970,7 @@ class PhysicalModelLayer extends ContainerLayer {
|
|||||||
/// The [clipPath], [elevation], and [color] arguments must not be null.
|
/// The [clipPath], [elevation], and [color] arguments must not be null.
|
||||||
PhysicalModelLayer({
|
PhysicalModelLayer({
|
||||||
@required this.clipPath,
|
@required this.clipPath,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use
|
this.clipBehavior = Clip.none,
|
||||||
@required this.elevation,
|
@required this.elevation,
|
||||||
@required this.color,
|
@required this.color,
|
||||||
@required this.shadowColor,
|
@required this.shadowColor,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'dart:ui' as ui show ImageFilter, Gradient, Image, defaultClipBehavior; // ignore: deprecated_member_use
|
import 'dart:ui' as ui show ImageFilter, Gradient, Image;
|
||||||
|
|
||||||
import 'package:flutter/animation.dart';
|
import 'package:flutter/animation.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@ -1500,7 +1500,7 @@ abstract class _RenderPhysicalModelBase<T> extends _RenderCustomClip<T> {
|
|||||||
@required double elevation,
|
@required double elevation,
|
||||||
@required Color color,
|
@required Color color,
|
||||||
@required Color shadowColor,
|
@required Color shadowColor,
|
||||||
Clip clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
Clip clipBehavior = Clip.none,
|
||||||
CustomClipper<T> clipper,
|
CustomClipper<T> clipper,
|
||||||
}) : assert(elevation != null),
|
}) : assert(elevation != null),
|
||||||
assert(color != null),
|
assert(color != null),
|
||||||
@ -1579,7 +1579,7 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase<RRect> {
|
|||||||
RenderPhysicalModel({
|
RenderPhysicalModel({
|
||||||
RenderBox child,
|
RenderBox child,
|
||||||
BoxShape shape = BoxShape.rectangle,
|
BoxShape shape = BoxShape.rectangle,
|
||||||
Clip clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
Clip clipBehavior = Clip.none,
|
||||||
BorderRadius borderRadius,
|
BorderRadius borderRadius,
|
||||||
double elevation = 0.0,
|
double elevation = 0.0,
|
||||||
@required Color color,
|
@required Color color,
|
||||||
@ -1738,7 +1738,7 @@ class RenderPhysicalShape extends _RenderPhysicalModelBase<Path> {
|
|||||||
RenderPhysicalShape({
|
RenderPhysicalShape({
|
||||||
RenderBox child,
|
RenderBox child,
|
||||||
@required CustomClipper<Path> clipper,
|
@required CustomClipper<Path> clipper,
|
||||||
Clip clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
Clip clipBehavior = Clip.none,
|
||||||
double elevation = 0.0,
|
double elevation = 0.0,
|
||||||
@required Color color,
|
@required Color color,
|
||||||
Color shadowColor = const Color(0xFF000000),
|
Color shadowColor = const Color(0xFF000000),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:ui' as ui show Image, ImageFilter, defaultClipBehavior; // ignore: deprecated_member_use
|
import 'dart:ui' as ui show Image, ImageFilter;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
@ -711,7 +711,7 @@ class PhysicalModel extends SingleChildRenderObjectWidget {
|
|||||||
const PhysicalModel({
|
const PhysicalModel({
|
||||||
Key key,
|
Key key,
|
||||||
this.shape = BoxShape.rectangle,
|
this.shape = BoxShape.rectangle,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
this.clipBehavior = Clip.none,
|
||||||
this.borderRadius,
|
this.borderRadius,
|
||||||
this.elevation = 0.0,
|
this.elevation = 0.0,
|
||||||
@required this.color,
|
@required this.color,
|
||||||
@ -799,7 +799,7 @@ class PhysicalShape extends SingleChildRenderObjectWidget {
|
|||||||
const PhysicalShape({
|
const PhysicalShape({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.clipper,
|
@required this.clipper,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
this.clipBehavior = Clip.none,
|
||||||
this.elevation = 0.0,
|
this.elevation = 0.0,
|
||||||
@required this.color,
|
@required this.color,
|
||||||
this.shadowColor = const Color(0xFF000000),
|
this.shadowColor = const Color(0xFF000000),
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:ui'as ui show defaultClipBehavior; // ignore: deprecated_member_use
|
|
||||||
|
|
||||||
import 'package:flutter/animation.dart';
|
import 'package:flutter/animation.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
@ -1183,7 +1181,7 @@ class AnimatedPhysicalModel extends ImplicitlyAnimatedWidget {
|
|||||||
Key key,
|
Key key,
|
||||||
@required this.child,
|
@required this.child,
|
||||||
@required this.shape,
|
@required this.shape,
|
||||||
this.clipBehavior = ui.defaultClipBehavior, // ignore: deprecated_member_use,
|
this.clipBehavior = Clip.none,
|
||||||
this.borderRadius = BorderRadius.zero,
|
this.borderRadius = BorderRadius.zero,
|
||||||
@required this.elevation,
|
@required this.elevation,
|
||||||
@required this.color,
|
@required this.color,
|
||||||
|
@ -308,7 +308,7 @@ void main() {
|
|||||||
tester.renderObject(find.byKey(buttonKey)),
|
tester.renderObject(find.byKey(buttonKey)),
|
||||||
paintsExactlyCountTimes(#clipPath, 0)
|
paintsExactlyCountTimes(#clipPath, 0)
|
||||||
);
|
);
|
||||||
}, skip: true);
|
});
|
||||||
|
|
||||||
testWidgets('Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics', (WidgetTester tester) async {
|
testWidgets('Disabled MaterialButton has same semantic size as enabled and exposes disabled semantics', (WidgetTester tester) async {
|
||||||
final SemanticsTester semantics = new SemanticsTester(tester);
|
final SemanticsTester semantics = new SemanticsTester(tester);
|
||||||
|
@ -182,7 +182,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(find.byKey(materialKey), hasNoImmediateClip);
|
expect(find.byKey(materialKey), hasNoImmediateClip);
|
||||||
}, skip: true);
|
});
|
||||||
|
|
||||||
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 {
|
||||||
final GlobalKey materialKey = new GlobalKey();
|
final GlobalKey materialKey = new GlobalKey();
|
||||||
|
@ -157,7 +157,7 @@ void main() {
|
|||||||
tester.renderObject(find.byKey(buttonKey)),
|
tester.renderObject(find.byKey(buttonKey)),
|
||||||
paintsExactlyCountTimes(#clipPath, 0)
|
paintsExactlyCountTimes(#clipPath, 0)
|
||||||
);
|
);
|
||||||
}, skip: true);
|
});
|
||||||
|
|
||||||
testWidgets('OutlineButton contributes semantics', (WidgetTester tester) async {
|
testWidgets('OutlineButton contributes semantics', (WidgetTester tester) async {
|
||||||
final SemanticsTester semantics = new SemanticsTester(tester);
|
final SemanticsTester semantics = new SemanticsTester(tester);
|
||||||
|
@ -534,7 +534,7 @@ void main() {
|
|||||||
find.byType(RepaintBoundary).first,
|
find.byType(RepaintBoundary).first,
|
||||||
matchesGoldenFile('clip.PhysicalModel.default.png'),
|
matchesGoldenFile('clip.PhysicalModel.default.png'),
|
||||||
);
|
);
|
||||||
}, skip: true);
|
});
|
||||||
|
|
||||||
Center genPhysicalShape(Clip clipBehavior) {
|
Center genPhysicalShape(Clip clipBehavior) {
|
||||||
return new Center(
|
return new Center(
|
||||||
@ -645,5 +645,5 @@ void main() {
|
|||||||
find.byType(RepaintBoundary).first,
|
find.byType(RepaintBoundary).first,
|
||||||
matchesGoldenFile('clip.PhysicalShape.default.png'),
|
matchesGoldenFile('clip.PhysicalShape.default.png'),
|
||||||
);
|
);
|
||||||
}, skip: true);
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user