mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that a Hero doesn't crash in 0x0 environment (#180954)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the Hero widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This commit is contained in:
parent
6c50f5605d
commit
b6efca7440
@ -3906,6 +3906,20 @@ Future<void> main() async {
|
||||
areCreateAndDispose,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('Hero does not crash at zero area', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: Hero(tag: 'imageHero', child: Text('X')),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(tester.getSize(find.byType(Hero)), Size.zero);
|
||||
});
|
||||
}
|
||||
|
||||
class TestDependencies extends StatelessWidget {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user