mirror of
https://github.com/AdrianKuta/android-challange-adrian-kuta.git
synced 2026-02-03 08:20:41 +01:00
This commit introduces functionality for selecting origin and destination airports on the home screen.
Key changes:
- Modified `HomeScreen` to use `Column` instead of `LazyColumn` for layout.
- Added `AirportDropdown` composable component for selecting airports.
- Updated `HomeScreen` to include two `AirportDropdown` instances: one for origin and one for destination.
- Enhanced `HomeScreenViewModel`:
- Added `selectedOriginAirport` and `selectedDestinationAirport` state flows.
- Implemented `selectOriginAirport` and `selectDestinationAirport` functions to update selected airports.
- Added `clearOriginAirport` and `clearDestinationAirport` functions.
- Updated `homeUiState` to combine airport data with selected airports and filter destination airports to exclude the selected origin.
- Updated `HomeUiState.Success` to include `originAirports`, `destinationAirports`, `selectedOriginAirport`, and `selectedDestinationAirport`.
- Added new preview functions for `HomeScreen` in loading and success states with mock data.