Skip to main content

Overview

The WonderData class is the primary data model for representing each of the Seven Wonders of the World in the Wonderous app. It contains comprehensive information including historical data, geographic coordinates, media references, and associated artifacts. Location: lib/logic/data/wonder_data.dart:5

Class Definition

class WonderData extends Equatable {
  const WonderData({
    required this.type,
    required this.title,
    required this.subTitle,
    required this.regionTitle,
    this.startYr = 0,
    this.endYr = 0,
    this.artifactStartYr = 0,
    this.artifactEndYr = 0,
    this.artifactCulture = '',
    this.artifactGeolocation = '',
    this.lat = 0,
    this.lng = 0,
    this.imageIds = const [],
    required this.unsplashCollectionId,
    required this.pullQuote1Top,
    required this.pullQuote1Bottom,
    required this.pullQuote1Author,
    this.pullQuote2 = '',
    this.pullQuote2Author = '',
    this.callout1 = '',
    this.callout2 = '',
    this.facts = const [],
    required this.historyInfo1,
    required this.historyInfo2,
    required this.constructionInfo1,
    required this.constructionInfo2,
    required this.locationInfo1,
    required this.locationInfo2,
    required this.videoId,
    this.videoCaption = '',
    this.mapCaption = '',
    required this.events,
    this.highlightArtifacts = const [],
    this.hiddenArtifacts = const [],
    this.searchData = const [],
    this.searchSuggestions = const [],
  });
}

Properties

Basic Information

type
WonderType
required
The type of wonder (e.g., WonderType.chichenItza, WonderType.tajMahal)
title
String
required
The display title of the wonder
subTitle
String
required
A subtitle or description of the wonder
regionTitle
String
required
The geographic region where the wonder is located

Timeline Information

startYr
int
default:"0"
The year construction or establishment began
endYr
int
default:"0"
The year construction or establishment ended
artifactStartYr
int
default:"0"
Starting year range for related artifacts
artifactEndYr
int
default:"0"
Ending year range for related artifacts

Geographic Data

lat
double
default:"0"
Latitude coordinate of the wonder’s location
lng
double
default:"0"
Longitude coordinate of the wonder’s location

Artifact Metadata

artifactCulture
String
default:"''"
The culture associated with the wonder’s artifacts
artifactGeolocation
String
default:"''"
Geolocation description for artifact searches

Content & Media

historyInfo1
String
required
Primary historical information text
historyInfo2
String
required
Secondary historical information text
constructionInfo1
String
required
Primary construction details text
constructionInfo2
String
required
Secondary construction details text
locationInfo1
String
required
Primary location information text
locationInfo2
String
required
Secondary location information text
pullQuote1Top
String
required
Top portion of the first pull quote
pullQuote1Bottom
String
required
Bottom portion of the first pull quote
pullQuote1Author
String
required
Author attribution for the first pull quote
pullQuote2
String
default:"''"
Second pull quote text
pullQuote2Author
String
default:"''"
Author attribution for the second pull quote
callout1
String
default:"''"
First callout text for highlighted information
callout2
String
default:"''"
Second callout text for highlighted information
videoId
String
required
YouTube video ID for the wonder’s featured video
videoCaption
String
default:"''"
Caption text for the video
mapCaption
String
default:"''"
Caption text for the map display
unsplashCollectionId
String
required
Unsplash collection ID for loading related images
imageIds
List<String>
default:"[]"
List of image identifiers for the wonder
facts
List<String>
default:"[]"
List of interesting facts about the wonder

Events & Artifacts

events
Map<int, String>
required
Timeline events mapped by year to event description
highlightArtifacts
List<String>
default:"[]"
List of artifact IDs used for highlight displays (internal use - used to assemble HighlightData)
hiddenArtifacts
List<String>
default:"[]"
List of artifact IDs used for collectible items (internal use - used to assemble CollectibleData)

Search Functionality

searchData
List<SearchData>
default:"[]"
List of searchable content associated with the wonder
searchSuggestions
List<String>
default:"[]"
Suggested search terms for the wonder

Methods

titleWithBreaks

String get titleWithBreaks => title.replaceFirst(' ', '\n');
Returns the wonder’s title with the first space replaced by a newline, useful for multi-line title displays.

WonderType Enum

Location: lib/logic/data/wonder_type.dart:1
enum WonderType {
  chichenItza,
  christRedeemer,
  colosseum,
  greatWall,
  machuPicchu,
  petra,
  pyramidsGiza,
  tajMahal,
}
Defines the eight wonders available in the application.

Wonder-Specific Data Classes

Each wonder has its own data class that extends WonderData and provides specific values for that wonder.

ChichenItzaData

Location: lib/logic/data/wonders_data/chichen_itza_data.dart:7
class ChichenItzaData extends WonderData {
  ChichenItzaData()
    : super(
        type: WonderType.chichenItza,
        title: \$strings.chichenItzaTitle,
        subTitle: \$strings.chichenItzaSubTitle,
        regionTitle: \$strings.chichenItzaRegionTitle,
        startYr: 550,
        endYr: 1550,
        lat: 20.68346184201756,
        lng: -88.56769676930931,
        // ... additional properties
      );
}

Similar Classes

  • ChristRedeemerData - Christ the Redeemer statue data
  • ColosseumData - Roman Colosseum data
  • GreatWallData - Great Wall of China data
  • MachuPicchuData - Machu Picchu data
  • PetraData - Petra data
  • PyramidsGizaData - Pyramids of Giza data
  • TajMahalData - Taj Mahal data
All follow the same pattern of extending WonderData with wonder-specific values.

Usage Example

// Get wonder data for Chichen Itza
final wonder = ChichenItzaData();

// Access basic properties
print(wonder.title); // "Chichen Itza"
print(wonder.regionTitle); // "Yucatan Peninsula, Mexico"

// Access timeline information
print(wonder.startYr); // 550
print(wonder.endYr); // 1550

// Access geographic coordinates
print(wonder.lat); // 20.68346184201756
print(wonder.lng); // -88.56769676930931

// Access events timeline
wonder.events.forEach((year, description) {
  print('$year: $description');
});

// Get title with line breaks for display
final displayTitle = wonder.titleWithBreaks;
  • ArtifactData - Artifact information referenced by highlightArtifacts and hiddenArtifacts
  • TimelineData - Timeline events structure used in events property
  • CollectibleData - Collectible items created from hiddenArtifacts
  • SearchData - Search content structure (defined in lib/logic/data/wonders_data/search/search_data.dart)

Build docs developers (and LLMs) love