mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that an AnimatedCrossFade does not crash in 0x0 environment (#180088)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the AnimatedCrossFade widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
parent
a35e01c8e7
commit
eb2e689a69
@ -396,6 +396,25 @@ void main() {
|
||||
|
||||
expect(numberOfTouchEventNoticed, 1);
|
||||
});
|
||||
|
||||
testWidgets('AnimatedCrossFade does not crash at zero area', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: AnimatedCrossFade(
|
||||
firstChild: Text('X'),
|
||||
secondChild: Text('Y'),
|
||||
crossFadeState: CrossFadeState.showFirst,
|
||||
duration: Duration(seconds: 1),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(tester.getSize(find.byType(AnimatedCrossFade)), Size.zero);
|
||||
});
|
||||
}
|
||||
|
||||
class _TickerWatchingWidget extends StatefulWidget {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user