Story constructor
Story({
- required String title,
- required String description,
- required String authors,
- required Page root,
- required Page currentPage,
- List<
HistoryItem> ? existingHistory, - required int year,
- ImageResolver? imageResolver,
Implementation
Story(
{required this.title,
required this.description,
required this.authors,
required this.root,
required this.currentPage,
List<HistoryItem>? existingHistory,
required this.year,
this.imageResolver}) {
history = existingHistory ?? List.empty(growable: true);
imageResolver ??= BackgroundImage.getRandomImageForType;
historyChanges = _streamHistory.stream;
// if the Story was just opened then add the very first node from current page to the history.
if (history.isEmpty) {
_logCurrentPassageToHistory();
}
}