Overview
Location:lib/logic/unsplash_logic.dart
The UnsplashLogic class provides access to pre-mapped Unsplash photo collections for each wonder. It acts as a facade for the UnsplashService and manages photo collection IDs.
Registration
Properties
Access to the underlying
UnsplashService for making API calls.Methods
getCollectionPhotos()
Retrieves the list of photo IDs for a given Unsplash collection.collectionId: The Unsplash collection ID (e.g.,"2072035"for Chichen Itza)
List<String>?: List of Unsplash photo IDs, ornullif collection not found
Photo Collections by Wonder
Fromlib/logic/data/unsplash_photo_data.dart, each wonder has a pre-mapped collection:
| Wonder | Collection ID | Photo Count |
|---|---|---|
| Chichen Itza | 2072035 | 25 photos |
| Christ the Redeemer | 9881936 | 25 photos |
| Colosseum | 7798262 | 25 photos |
| Great Wall | 3668012 | 25 photos |
| Machu Picchu | 3237397 | 25 photos |
| Petra | 5109404 | 25 photos |
| Pyramids of Giza | 1146829 | 25 photos |
| Taj Mahal | 6605554 | 25 photos |
UnsplashPhotoData Structure
The pre-mapped photo collections are defined inUnsplashPhotoData:
Photo URL Construction
Photo URLs are constructed using Unsplash CDN patterns:Usage in Photo Gallery
The photo gallery uses a 5×5 grid to display 25 photos:Self-Hosted Fallback
For production reliability, Wonderous uses a self-hosted CDN as fallback:Integration with Collectibles
Certain photos in the gallery hide collectibles. When a user navigates to specific grid positions, collectibles are discovered:API Configuration
Unsplash API credentials are configured in:- Development: Uses Unsplash API directly with API key
- Production: Uses self-hosted CDN for better performance and reliability
Related
- Unsplash Integration - API setup and configuration
- Photo Gallery Feature - 5×5 grid navigation system
- Collectibles Feature - Hidden artifacts in photos
- WonderData -
unsplashCollectionIdproperty