Timeline Range
The timeline spans over 5000 years of history:lib/logic/wonders_logic.dart
Timeline Data Model
Events are represented by theTimelineEvent class:
lib/logic/data/timeline_data.dart
Global Historical Events
TheGlobalEventsData class contains major world events:
lib/logic/data/timeline_data.dart
Timeline Logic
TheTimelineLogic class merges global events with wonder construction events:
lib/logic/timeline_logic.dart
- 40+ global historical events
- 8 wonder construction events
- Chronologically sorted by year
Timeline Screen UI
The timeline features a sophisticated vertically scrolling interface:lib/ui/screens/timeline/timeline_screen.dart
Key Components
Scrolling Viewport
The main scrollable area displays events along a vertical timeline:- Year Markers: Major year labels positioned along the timeline
- Event Markers: Dots indicating event positions
- Event Popups: Cards that appear when hovering/selecting events
- Dashed Dividers: Visual separators with year labels
Bottom Scrubber
A miniature horizontal timeline that:- Shows the full timeline range in a compressed view
- Indicates current scroll position
- Allows quick navigation by dragging
- Highlights the selected wonder (if specified)
Animated Era Text
Displays the current historical era based on the visible year:Timeline Sections
The timeline is divided into logical sections for better organization:Event Markers
Events appear as markers along the timeline:Event Popups
When users interact with events, detailed popup cards appear:- Event year and description
- Related images (for wonder events)
- Context about the historical significance
- Navigation to related wonder details
Wonder Integration
When viewing a specific wonder’s timeline:- Larger markers
- Accent color highlighting
- Wonder icon/image
- Direct link to wonder details
Scrolling Controller
The custom scrolling viewport controller manages:Performance Optimizations
- Lazy Loading: Only render visible events
- Viewport Culling: Events outside viewport are not built
- Debounced Updates: Year changes are debounced to reduce rebuilds
- RepaintBoundary: Isolate expensive widgets
- Const Constructors: Use const where possible
Accessibility Features
- Semantic labels for all events
- Scroll announcements
- Keyboard navigation support
- High contrast mode support
- Screen reader optimizations
User Interactions
- Vertical Scroll: Navigate through time
- Horizontal Scrubber Drag: Quick jump to specific years
- Event Tap: Show event details
- Wonder Filter: View only wonder-related events
- Trackpad Gestures: Smooth scrolling with momentum