Unverified Commit 9d7bdb59 authored by Yuqian Li's avatar Yuqian Li Committed by GitHub

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
parent 47288927
......@@ -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
......
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment