mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
4728892753
commit
9d7bdb5903
@ -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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user