InkList.fromString constructor

InkList.fromString(
  1. String myListItem,
  2. Story originStory
)
Converts a string to an ink list and returns for use in the story. Item key. Origin story.

Implementation

factory InkList.fromString(String myListItem, Story originStory) {
  var listValue =
      originStory.listDefinitions?.findSingleItemListWithName(myListItem);
  if (listValue != null) {
    return InkList.of(listValue.value);
  } else {
    throw Exception("Could not find the InkListItem from the string '" +
        myListItem +
        "' to create an InkList because it doesn't exist in the original list definition in ink.");
  }
}