Page class

Constructors

Page({required List<PageNode> nodes, int currentIndex = 0, required List<PageNext> next, EndType? endType})
Page.empty()

Properties

currentIndex int
Pointer to the current node.
getter/setter pair
endType EndType?
Is not null if the Page is the end of the story.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
next List<PageNext>
List of next choices which are shown to user.
getter/setter pair
nodes List<PageNode>
List of the passages of the page.
getter/setter pair
parent Page?
The reference to the Page from which user can get to this page.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addNextPageWithText(String text) → void
Used by the Editor to add choice with next page.
addNodeWithText(String text) → void
Add a new node (paragraph) to the current page.
addNodeWithTextAtIndex(String text, int index) → void
Used by the Editor to insert new node at specific index.
changeParent(Page page) → void
Used to reassign page to another place in the Story.
deleteCurrentNode() → void
Deletes nodes at current index
deleteNodeAt(dynamic index) → void
deletes node at given index.
getCurrentNode() PageNode
getCurrentText() String?
Returns text of the current node.
getNextNodeTexts() List<String?>
hasNext() bool
Returns true if there are choices on the page.
hasNextNode() bool
Returns true if there are more nodes.
isRoot() bool
Returns true if the page does not have parents.
isTheEnd() bool
Used to notify the Player that the Story has ended.
nextNode() → void
Used by the Editor to navigate to the next node.
normalizeIndex() → void
puts current index back into range of nodes list values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
previousNode() → void
Used to go to the previous node
removeNextPage(PageNext page) → void
Used by the Editor to remove choice with the page.
removeNode(PageNode node) → void
Used by the Editor to remove the node by reference.
removeNodeAtIndex(int i) → void
Used by the Editor to remove the node at specific index.
toMap() Map<String, dynamic>
Used to serialize Page instance to map for persistence.
toStateMap() Map<String, dynamic>
Used to serialize Page instance with state to map for persistence.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromJSON(String input) Page
Used to deserialize Page from the json string.
fromMap(Map<String, dynamic>? map) Page
Used to deserialize from the map into Page instance.
generate() Page
Used to generate dummy Page.