mirror of https://github.com/flutter/samples.git
gh-pages
main
flutter3.27
compass-app
jwill_m3_demo
sethladd-patch-3
sethladd-patch-1
sethladd-patch-2
recipe_readme
add_ai_recipe_app
remove_window_size_nav_app
android-builds
startup_cleanup
misc/adjust-flutter-gallery-inclusion
khanh_m3_demo
leigha_m3_demo
add_interactive_color_scheme
update_card_to_card_outlined
navigation-and-routing-update
update_demo_code
master_archived
${ noResults }
3 Commits (415fdbbf1ba8aefab43a6cc9977ae28bce20dede)
Author | SHA1 | Message | Date |
---|---|---|---|
Miguel Beltran |
b00ce6c7b3
|
[Compass App] User name and profile picture (#2435)
This PR completes the home screen, adding the username and the profile picture. ![Screenshot from 2024-09-11 14-52-32](https://github.com/user-attachments/assets/197f9932-ae86-4277-92ac-8fd413b52010) ![Screenshot from 2024-09-11 14-52-23](https://github.com/user-attachments/assets/915b8c54-ac85-40d9-adb8-3bf0521b78f5) This feature follows the basic structure: - Added repository, both local and remote. - Added API call + API model. - Added Domain model (reduced version only containing name and profile picture). - Modified the ViewModel to obtain the user and expose it to the Widget. - Updated Widget to display the username and profile picture. - Added `/user` endpoint to server project. - Updated widget tests, as well as integration tests. The Compass App is basically completed with it. Maybe the next step is to merge it to the `main` branch? And then we can do a full review, remove TODOs and setup CI jobs. ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md |
2 months ago |
Miguel Beltran |
fb869e729e
|
[Compass App] Home screen with booking list (#2428)
This PR introduces the storage and retrieval of bookings. ### Server implementation - New booking routes: - GET `/booking`: Obtain the list ofer user bookings - GET `/booking/{id}`: Obtain the specific booking object - POST `/booking`: Creates a new booking - The `BookingApiModel` objects are incomplete, the `Destination` is a reference, not the full object, and the `Activity` list are also listed as references only. - Server booking always has an existing booking created (Alaska, North America) for demo purposes. - Storage is "in memory", stopping the server deletes all stored bookings. ### New `BookingRepository` - New repository class. - Both local and remote implementations. - Converts the `BookingApiModel` into a complete `Booking` that the app can use, or a `BookingSummary` that only contains the necessary information for the home screen. ### New `LocalDataService` - Service that loads hard-coded data or from assets. ### New `HomeScreen` - Route path: `/` - Loads and displays the list of created bookings from the `BookingRepository`. - Tap on a booking title opens the `BookingScreen`. - Floating Action Button to create a new booking. ### Changes in `BookingScreen` - Can be accessed at the end of creating a booking or from the home screen when tapping a booking title. - Two commands: - `createBooking`: Takes the stored `ItineraryConfig` and creates a booking, the booking is stored to the `BookingRepository` (locally or on the server). - `loadBooking`: Takes a booking ID and loads that existing booking from the `BookingRepository`. - Simplified navigation: Once at `BookingScreen`, user can only navigate back to `HomeScreen`. - Share button converted to `FloatingActionButton` ### Integration Tests - Updated to use new home screen. - Updated to cover opening an existing booking in tests. ### TODO Next - Refactor the `compass_model` project and move data model classes to `server` and `app`, then delete project. - Implement some user information for the home screen (e.g. retrieve user name and profile picture url) ### Screencast [Screencast from 2024-09-02 16-25-25.webm](https://github.com/user-attachments/assets/8aba4a61-def6-4752-a4e5-70cbed362524) ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md |
3 months ago |
Miguel Beltran |
56bf31fa21
|
Compass App: Integration tests and image error handling (#2389)
This PR goes on top of PR #2385 adding integration test using the `integration_test` package. Adds `integration_test` folder with two test suits: - Local test: Uses the local dependency config that pulls data from the assets folder and has no login logic. - Remote test: Starts the dart server in the background and uses the remote dependency config, pulls data from the server and performs login/logout. To run the tests: ``` flutter test integration_test/app_server_data_test.dart ``` or ``` flutter test integration_test/app_local_data_test.dart ``` Running both at once with `flutter test integration_test` will likely fail, seems this issue is related: https://github.com/flutter/flutter/issues/101031 Also, this PR fixes exceptions being thrown by the network image library, now instead they get logged using the app `Logger`. ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md |
3 months ago |