Default FittedBox's clipBehavior to none (#66700)

This is a continuation of https://github.com/flutter/flutter/pull/61366
after cl/333620714

See also https://flutter.dev/go/clip-behavior
This commit is contained in:
Yuqian Li 2020-09-28 22:46:21 -07:00 committed by GitHub
parent 4728892753
commit 9d7bdb5903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1424,7 +1424,7 @@ class FittedBox extends SingleChildRenderObjectWidget {
Key? key,
this.fit = BoxFit.contain,
this.alignment = Alignment.center,
this.clipBehavior = Clip.hardEdge,
this.clipBehavior = Clip.none,
Widget? child,
}) : assert(fit != null),
assert(alignment != null),
@ -1452,7 +1452,7 @@ class FittedBox extends SingleChildRenderObjectWidget {
/// {@macro flutter.widgets.Clip}
///
/// Defaults to [Clip.hardEdge].
/// Defaults to [Clip.none].
final Clip clipBehavior;
@override

View File

@ -481,7 +481,7 @@ void main() {
testWidgets('Can set and update clipBehavior', (WidgetTester tester) async {
await tester.pumpWidget(FittedBox(fit: BoxFit.none, child: Container()));
final RenderFittedBox renderObject = tester.allRenderObjects.whereType<RenderFittedBox>().first;
expect(renderObject.clipBehavior, equals(Clip.hardEdge));
expect(renderObject.clipBehavior, equals(Clip.none));
await tester.pumpWidget(FittedBox(fit: BoxFit.none, child: Container(), clipBehavior: Clip.antiAlias));
expect(renderObject.clipBehavior, equals(Clip.antiAlias));