From 21c0151dbb91ee1ce01b64071f4762d29860d5d7 Mon Sep 17 00:00:00 2001 From: Eric Windmill Date: Thu, 26 Sep 2024 15:16:41 -0400 Subject: [PATCH] address comments on PR --- compass_app/app/analysis_options.yaml | 2 +- .../android/app/src/main/res/values-night/styles.xml | 6 ------ .../app/android/app/src/main/res/values/styles.xml | 6 ------ .../android/gradle/wrapper/gradle-wrapper.properties | 2 +- .../app/integration_test/app_local_data_test.dart | 10 ++++++---- .../lib/ui/activities/widgets/activities_screen.dart | 4 +++- compass_app/app/lib/ui/home/widgets/home_screen.dart | 4 +++- .../lib/ui/search_form/widgets/search_form_guests.dart | 7 +++++-- .../lib/ui/search_form/widgets/search_form_submit.dart | 4 +++- 9 files changed, 22 insertions(+), 23 deletions(-) diff --git a/compass_app/app/analysis_options.yaml b/compass_app/app/analysis_options.yaml index a6f303cb9..59af2e887 100644 --- a/compass_app/app/analysis_options.yaml +++ b/compass_app/app/analysis_options.yaml @@ -2,4 +2,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - - prefer_relative_imports \ No newline at end of file + - prefer_relative_imports diff --git a/compass_app/app/android/app/src/main/res/values-night/styles.xml b/compass_app/app/android/app/src/main/res/values-night/styles.xml index 06952be74..4732e853e 100644 --- a/compass_app/app/android/app/src/main/res/values-night/styles.xml +++ b/compass_app/app/android/app/src/main/res/values-night/styles.xml @@ -6,12 +6,6 @@ the Flutter engine draws its first frame --> @drawable/launch_background - diff --git a/compass_app/app/android/app/src/main/res/values/styles.xml b/compass_app/app/android/app/src/main/res/values/styles.xml index cb1ef8805..ce8badf37 100644 --- a/compass_app/app/android/app/src/main/res/values/styles.xml +++ b/compass_app/app/android/app/src/main/res/values/styles.xml @@ -6,12 +6,6 @@ the Flutter engine draws its first frame --> @drawable/launch_background - diff --git a/compass_app/app/android/gradle/wrapper/gradle-wrapper.properties b/compass_app/app/android/gradle/wrapper/gradle-wrapper.properties index 7bb2df6ba..5e6b54271 100644 --- a/compass_app/app/android/gradle/wrapper/gradle-wrapper.properties +++ b/compass_app/app/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip diff --git a/compass_app/app/integration_test/app_local_data_test.dart b/compass_app/app/integration_test/app_local_data_test.dart index 773fcde26..8bbe5e276 100644 --- a/compass_app/app/integration_test/app_local_data_test.dart +++ b/compass_app/app/integration_test/app_local_data_test.dart @@ -7,7 +7,9 @@ import 'package:compass_app/ui/core/ui/home_button.dart'; import 'package:compass_app/ui/home/widgets/home_screen.dart'; import 'package:compass_app/ui/results/widgets/result_card.dart'; import 'package:compass_app/ui/results/widgets/results_screen.dart'; +import 'package:compass_app/ui/search_form/widgets/search_form_guests.dart'; import 'package:compass_app/ui/search_form/widgets/search_form_screen.dart'; +import 'package:compass_app/ui/search_form/widgets/search_form_submit.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; @@ -71,7 +73,7 @@ void main() { await tester.pumpAndSettle(); // Select create new booking - await tester.tap(find.byKey(const ValueKey('booking-button'))); + await tester.tap(find.byKey(const ValueKey(bookingButtonKey))); await tester.pumpAndSettle(); // Search destinations screen @@ -95,14 +97,14 @@ void main() { await tester.pumpAndSettle(); // Select guests - await tester.tap(find.byKey(const ValueKey('add_guests')), + await tester.tap(find.byKey(const ValueKey(addGuestsKey)), warnIfMissed: false); // Refresh screen state await tester.pumpAndSettle(); // Perform search and navigate to next screen - await tester.tap(find.byKey(const ValueKey('submit_button'))); + await tester.tap(find.byKey(const ValueKey(submitButtonKey))); await tester.pumpAndSettle(); // Results Screen @@ -122,7 +124,7 @@ void main() { expect(find.text('1 selected'), findsOneWidget); // Submit selection - await tester.tap(find.byKey(const ValueKey('confirm-button'))); + await tester.tap(find.byKey(const ValueKey(confirmButtonKey))); await tester.pumpAndSettle(); // Should be at booking screen diff --git a/compass_app/app/lib/ui/activities/widgets/activities_screen.dart b/compass_app/app/lib/ui/activities/widgets/activities_screen.dart index 64316fcfa..00565e74a 100644 --- a/compass_app/app/lib/ui/activities/widgets/activities_screen.dart +++ b/compass_app/app/lib/ui/activities/widgets/activities_screen.dart @@ -15,6 +15,8 @@ import 'activities_list.dart'; import 'activities_title.dart'; import 'activity_time_of_day.dart'; +const String confirmButtonKey = 'confirm-button'; + class ActivitiesScreen extends StatefulWidget { const ActivitiesScreen({ super.key, @@ -171,7 +173,7 @@ class _BottomArea extends StatelessWidget { style: Theme.of(context).textTheme.labelLarge, ), FilledButton( - key: const Key('confirm-button'), + key: const Key(confirmButtonKey), onPressed: viewModel.selectedActivities.isNotEmpty ? viewModel.saveActivities.execute : null, diff --git a/compass_app/app/lib/ui/home/widgets/home_screen.dart b/compass_app/app/lib/ui/home/widgets/home_screen.dart index 730397225..5a3fce717 100644 --- a/compass_app/app/lib/ui/home/widgets/home_screen.dart +++ b/compass_app/app/lib/ui/home/widgets/home_screen.dart @@ -14,6 +14,8 @@ import '../../core/ui/error_indicator.dart'; import '../view_models/home_viewmodel.dart'; import 'home_title.dart'; +const String bookingButtonKey = 'booking-button'; + class HomeScreen extends StatefulWidget { const HomeScreen({ super.key, @@ -52,7 +54,7 @@ class _HomeScreenState extends State { floatingActionButton: FloatingActionButton.extended( // Workaround for https://github.com/flutter/flutter/issues/115358#issuecomment-2117157419 heroTag: null, - key: const ValueKey('booking-button'), + key: const ValueKey(bookingButtonKey), onPressed: () => context.go(Routes.search), label: Text(AppLocalization.of(context).bookNewTrip), icon: const Icon(Icons.add_location_outlined), diff --git a/compass_app/app/lib/ui/search_form/widgets/search_form_guests.dart b/compass_app/app/lib/ui/search_form/widgets/search_form_guests.dart index 9e87d3601..e803dd11d 100644 --- a/compass_app/app/lib/ui/search_form/widgets/search_form_guests.dart +++ b/compass_app/app/lib/ui/search_form/widgets/search_form_guests.dart @@ -8,6 +8,9 @@ import '../../core/themes/colors.dart'; import '../../core/themes/dimens.dart'; import '../view_models/search_form_viewmodel.dart'; +const String removeGuestsKey = 'remove-guests'; +const String addGuestsKey = 'add-guests'; + /// Number of guests selection form /// /// Users can tap the Plus and Minus icons to increase or decrease @@ -67,7 +70,7 @@ class _QuantitySelector extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( - key: const ValueKey('remove_guests'), + key: const ValueKey(removeGuestsKey), onTap: () { viewModel.guests--; }, @@ -86,7 +89,7 @@ class _QuantitySelector extends StatelessWidget { ), ), InkWell( - key: const ValueKey('add_guests'), + key: const ValueKey(addGuestsKey), onTap: () { viewModel.guests++; }, diff --git a/compass_app/app/lib/ui/search_form/widgets/search_form_submit.dart b/compass_app/app/lib/ui/search_form/widgets/search_form_submit.dart index 3f5a81b11..521c717ff 100644 --- a/compass_app/app/lib/ui/search_form/widgets/search_form_submit.dart +++ b/compass_app/app/lib/ui/search_form/widgets/search_form_submit.dart @@ -11,6 +11,8 @@ import '../../core/themes/dimens.dart'; import '../../results/widgets/results_screen.dart'; import '../view_models/search_form_viewmodel.dart'; +const String submitButtonKey = 'submit-button'; + /// Search form submit button /// /// The button is disabled when the form is data is incomplete. @@ -67,7 +69,7 @@ class _SearchFormSubmitState extends State { ), builder: (context, child) { return FilledButton( - key: const ValueKey('submit_button'), + key: const ValueKey(submitButtonKey), onPressed: widget.viewModel.valid ? widget.viewModel.updateItineraryConfig.execute : null,