mirror of https://github.com/flutter/samples.git
main
dependabot/npm_and_yarn/web_embedding/ng-flutter/angular/cdk-21.0.3
dependabot/npm_and_yarn/web_embedding/ng-flutter/angular/common-21.0.5
dependabot/npm_and_yarn/web_embedding/ng-flutter/angular/compiler-cli-21.0.5
dependabot/npm_and_yarn/web_embedding/ng-flutter/angular/platform-browser-21.0.5
dependabot/npm_and_yarn/web_embedding/ng-flutter/angular/router-21.0.5
cupertino-gallery
master_archived
${ noResults }
3 Commits (e1a35cc378abcffe8e2bb5f010489624b06f9c8d)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
b00ce6c7b3
|
[Compass App] User name and profile picture (#2435)
This PR completes the home screen, adding the username and the profile picture.   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 |
1 year ago |
|
|
93b86b86f3
|
[Compass App] Refactor model (#2431)
This PR removes the `compass_model` subproject and moves each data model class to the respective `app` or `server` project. Although this leads to code duplication, this is a more realistic implementation where clients and servers have their own respective data model class implementations. The model classes for the server are located in `server/lib/model`. Model classes for the app are located in two places: - API-only model: `app/lib/data/services/api/model`. - Domain model: `app/lib/domain/model`. In general, models located under the domain are used across the app, while the API-only models are only used for interacting with the API client. Tests have been updated. ## 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 |
1 year ago |
|
|
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
|
1 year ago |