Skip to content

Commit

Permalink
fix: tutorial text was cut off (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsgalarraga authored Jun 25, 2024
1 parent 46a6f5a commit b93eaa0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
10 changes: 4 additions & 6 deletions lib/drawer/view/crossword_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ class CrosswordDrawer extends StatelessWidget {
constraints: BoxConstraints(
maxWidth: switch (layout) {
IoLayoutData.small => 375,
IoLayoutData.large => 375,
IoLayoutData.large => 500,
},
),
child: SingleChildScrollView(
child: HowToPlayContent(
mascot: mascot,
onDonePressed: () => Navigator.pop(context),
),
child: HowToPlayContent(
mascot: mascot,
onDonePressed: () => Navigator.pop(context),
),
),
),
Expand Down
15 changes: 10 additions & 5 deletions lib/how_to_play/widgets/how_to_play_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ class HowToPlayStep extends StatelessWidget {

final String image;

static const double smallTextHeight = 88;
static const double smallTextHeight = 136;

static const double largeTextHeight = 104;

static const double largeTextHeight = 66;
@override
Widget build(BuildContext context) {
final layout = IoLayout.of(context);
Expand All @@ -210,9 +211,12 @@ class HowToPlayStep extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: Theme.of(context).io.textStyles.h2,
FittedBox(
fit: BoxFit.fitWidth,
child: Text(
title,
style: Theme.of(context).io.textStyles.h2,
),
),
const SizedBox(height: 24),
Container(
Expand All @@ -234,6 +238,7 @@ class HowToPlayStep extends StatelessWidget {
child: Text(
message,
style: Theme.of(context).io.textStyles.body3,
textAlign: TextAlign.justify,
),
),
],
Expand Down
8 changes: 6 additions & 2 deletions test/how_to_play/view/how_to_play_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void main() {
assetsStatus: AssetsLoadingStatus.success,
),
);
await tester.pumpApp(widget);
await tester.pumpApp(widget, layout: IoLayoutData.large);

await tester.tap(find.text(l10n.doneButtonLabel));

Expand All @@ -335,7 +335,11 @@ void main() {
assetsStatus: AssetsLoadingStatus.success,
),
);
await tester.pumpApp(widget, user: User(id: 'userId'));
await tester.pumpApp(
widget,
user: User(id: 'userId'),
layout: IoLayoutData.large,
);

await tester.tap(find.text(l10n.doneButtonLabel));

Expand Down

0 comments on commit b93eaa0

Please sign in to comment.