mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that an AnimatedAlign doesn't crash in 0x0 environment (#181361)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the AnimatedAlign widget.
This commit is contained in:
parent
1c0ccb5ce6
commit
2e64b79fd9
@ -146,4 +146,22 @@ void main() {
|
||||
final RenderBox box = tester.renderObject<RenderBox>(find.byType(SizedBox).last);
|
||||
expect(box.size, equals(const Size(100.0, 100)));
|
||||
});
|
||||
|
||||
testWidgets('AnimatedAlign does not crash at zero area', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: AnimatedAlign(
|
||||
alignment: Alignment.bottomCenter,
|
||||
duration: Duration(milliseconds: 50),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.getSize(find.byType(AnimatedAlign)), Size.zero);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user