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