Skip to content

[Compass App] Booking screen #2380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Aug 12, 2024
Merged

[Compass App] Booking screen #2380

merged 24 commits into from
Aug 12, 2024

Conversation

miquelbeltran
Copy link
Member

@miquelbeltran miquelbeltran commented Aug 6, 2024

This PR adds the Booking screen at the end of the main app flow.

After the user selects Activitys, these get stored in the ItineraryConfig and then the user navigates to the BookingScreen.
In the BookingScreen, a Booking is generated with the BookingCreateComponent.
This component communicates with multiple repositories, and it is a bit more complex than the average view model, something that we want to show as discussed in the previous PRs.

Screenshots

image
image

In the BookingScreen, the user can tap on "share trip" which displays the OS share sheet functionality. This uses the plugin share_plus, but the functionality is also wrapped in the BookingShareComponent, which takes a Booking object and creates a shareable string, then calls to the Share.share() method from share_plus. But the share_plus dependency is also injected into the BookingShareComponent, allowing us to unit test without plugin dependencies.

This is an example of a shared booking to instant messaging:

image

TODO

  • I want to take a look at the whole experience on mobile, as I noticed some inconsistent UI and navigation issues that I couldn't see on Desktop. I will submit those in a new PR.
  • We also talked about user authentication in the design document. I will work on that once we are happy with the main app flow.

Pre-launch Checklist

  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I read the Contributors Guide.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel channel on Discord.

@@ -19,7 +19,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "org.jetbrains.kotlin.android" version "1.8.0" apply false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a requirement for share_plus

@@ -3,7 +3,7 @@ import 'package:compass_app/data/repositories/activity/activity_repository_remot
import 'package:compass_app/utils/result.dart';
import 'package:flutter_test/flutter_test.dart';

import '../../../util/fakes/services/fake_api_client.dart';
import '../../../../testing/fakes/services/fake_api_client.dart';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing utils have been moved to the top level testing folder. i.e. compass-app/app/testing

Future<Result<List<Continent>>> getContinents() async {
return Result.ok([
Future<Result<List<Continent>>> getContinents() {
return SynchronousFuture(Result.ok([
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to using SynchronousFuture in tests when possible as I had issues with timeouts in widget tests

@miquelbeltran miquelbeltran marked this pull request as ready for review August 6, 2024 15:09
@miquelbeltran
Copy link
Member Author

I've fixed UI navigation on mobile (the back button / pop scope) as well as a couple of warnings on Flutter 3.24.0

@miquelbeltran
Copy link
Member Author

Merging it and moving into the next feature, creating a basic auth flow

@miquelbeltran miquelbeltran merged commit 0c88289 into compass-app Aug 12, 2024
1 check passed
@miquelbeltran miquelbeltran deleted the mb-compass-app-book branch August 12, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants