fix: how to play screen can't be dismissed (#293)

Co-authored-by: Tom Arra <tarra3@gmail.com>
pull/297/head
Jochum van der Ploeg 3 years ago committed by GitHub
parent 49b306ff0f
commit 8d10cf6434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,7 +52,6 @@ extension on Control {
Future<void> showHowToPlayDialog(BuildContext context) { Future<void> showHowToPlayDialog(BuildContext context) {
return showDialog<void>( return showDialog<void>(
context: context, context: context,
barrierDismissible: false,
builder: (_) => HowToPlayDialog(), builder: (_) => HowToPlayDialog(),
); );
} }

@ -73,5 +73,25 @@ void main() {
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.byType(HowToPlayDialog), findsNothing); expect(find.byType(HowToPlayDialog), findsNothing);
}); });
testWidgets('can be dismissed', (tester) async {
await tester.pumpApp(
Builder(
builder: (context) {
return TextButton(
onPressed: () => showHowToPlayDialog(context),
child: const Text('test'),
);
},
),
);
expect(find.byType(HowToPlayDialog), findsNothing);
await tester.tap(find.text('test'));
await tester.pumpAndSettle();
await tester.tapAt(Offset.zero);
await tester.pumpAndSettle();
expect(find.byType(HowToPlayDialog), findsNothing);
});
}); });
} }

Loading…
Cancel
Save