Skip to content

Commit

Permalink
Center title in completion view, fix build by upgrading version of fl…
Browse files Browse the repository at this point in the history
…utter_platform_widgets, and fix a test (#133)

* center title in completion view

* update version of flutter_platform_widgets

* fix test: the test sets up texts in lowercase but searches for uppercase texts afterwards; I'm not sure why this worked before

---------

Co-authored-by: Joshua Schmidt <[email protected]>
  • Loading branch information
Joshua27 and Joshua Schmidt committed Sep 26, 2023
1 parent 8867f8c commit 559c31d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/src/views/completion_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class CompletionView extends StatelessWidget {
DateTime.now(),
),
title: Text(completionStep.title,
style: Theme.of(context).textTheme.displayMedium),
style: Theme.of(context).textTheme.displayMedium,
textAlign: TextAlign.center),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 64.0),
child: Column(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
flutter:
sdk: flutter
flutter_bloc: ^8.0.1
flutter_platform_widgets: ^2.2.6
flutter_platform_widgets: ^3.3.5
go_router: ^6.0.1
image_picker: ^0.8.5+3
intl: ^0.18.0
Expand Down
6 changes: 3 additions & 3 deletions test/surveykit_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ void main() {
await tester.pumpWidget(surveyWidget);
await tester.pumpAndSettle();

final introButton = find.text('Let\'s go!'.toUpperCase());
final introButton = find.text('Let\'s go!');
expect(introButton, findsOneWidget);
await tester.tap(introButton);

await tester.pumpAndSettle();
final textField = find.byType(TextField);
await tester.enterText(textField, '20');
await tester.pumpAndSettle();
final questionButton = find.text('Next'.toUpperCase());
final questionButton = find.text('Next');
expect(questionButton, findsOneWidget);
await tester.tap(questionButton);

await tester.pumpAndSettle();
final completeButtom = find.text('Submit survey'.toUpperCase());
final completeButtom = find.text('Submit survey');
expect(completeButtom, findsOneWidget);
await tester.tap(completeButtom);
});
Expand Down

0 comments on commit 559c31d

Please sign in to comment.