address comments on PR

compass-app
Eric Windmill 4 months ago
parent 6250b55ad4
commit 21c0151dbb

@ -2,4 +2,4 @@ include: package:flutter_lints/flutter.yaml
linter:
rules:
- prefer_relative_imports
- prefer_relative_imports

@ -6,12 +6,6 @@
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>

@ -6,12 +6,6 @@
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>

@ -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

@ -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

@ -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,

@ -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<HomeScreen> {
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),

@ -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++;
},

@ -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<SearchFormSubmit> {
),
builder: (context, child) {
return FilledButton(
key: const ValueKey('submit_button'),
key: const ValueKey(submitButtonKey),
onPressed: widget.viewModel.valid
? widget.viewModel.updateItineraryConfig.execute
: null,

Loading…
Cancel
Save