Collectible States
Collectibles can exist in three states:lib/logic/data/collectible_data.dart
Collectible Data Model
lib/logic/data/collectible_data.dart
Collectibles Per Wonder
Each wonder has 3 hidden collectibles (24 total):lib/logic/data/collectible_data.dart
Icon Types
jewelry- Pendants, ornaments, daggersvase- Jars, bowls, vesselsstatue- Figurines, sculpturesscroll- Documents, calligraphy, papyrustextile- Fabrics, tapestriespicture- Paintings, photographs
Collectibles Logic
TheCollectiblesLogic class manages the collection system:
lib/logic/collectibles_logic.dart
State Management
Setting State
lib/logic/collectibles_logic.dart
Tracking Counts
Persistence
Collectibles state is saved to disk using theThrottledSaveLoadMixin:
- Automatic throttled saves (prevents excessive disk writes)
- JSON serialization
- Loads on app start
- Persists across app restarts
- File:
collectibles.dat
Discovery Mechanism
Collectibles are discovered through exploration:Photo Gallery Discovery
One collectible hidden in each wonder’s photo gallery:lib/ui/screens/photo_gallery/photo_gallery.dart
Hidden Collectible Widget
Displays an animated collectible icon that users can tap:Collectible Found Screen
When a collectible is discovered, a celebration screen appears:lib/ui/screens/collectible_found/collectible_found_screen.dart
Celebration Effects
- Particles: Confetti-like particles rain down
- Ribbon: Animated ribbon unfurls
- Haptics: Success haptic feedback
- Sound: Optional sound effect
Collection Screen
The collection screen displays all collectibles:lib/ui/screens/collection/collection_screen.dart
Collection List
Grouped by wonder:Collection Card States
Home Widget Integration
Updating Home Widget
Home Widget Data
- lastDiscoveredTitle: Collectible name
- lastDiscoveredSubTitle: Artifact date
- lastDiscoveredImageData: Base64 encoded image
- discoveredCount: Total found count
Reset Functionality
Query Methods
User Experience Flow
- Discovery: User explores photo gallery and finds hidden collectible
- Celebration: Collectible Found screen with animations
- State Change: Collectible marked as “discovered”
- Home Widget: Updates to show latest find
- Collection View: User can view in collection
- State Change: When viewed in detail, marked as “explored”
- Progress: Total progress updates (e.g., “18/24 collected”)