Comment on page
This page contains infromation of AdvStoryController properties.
Provides methods for manipulating
AdvStorydefault flow and for listening events.
// Define controller in your code
final controller = AdvStoryController();
Returns true if a story view is currently visible. Some methods like toNextStory, toPreviousCluster can't be used and throws an exception if the story view is not visible.
Displaying story and content position. Returns
0,0if no story is currently displayed.
Total count of stories.
Total content count in currently displaying story
Returns true if gestures are disabled, false otherwise.
Returns true if footer, header and indicators are visible, false otherwise.
Returns true if the story is paused, false otherwise.
Register a closure to be called when any story event happens. Events can be triggered by the user or automatically. Event types are:
typedef StoryEventCallback = FutureOr<void> Function(
/// Event type
/// Current cluster and story index in cluster
Removes a previously registered closure from the list of closures that are notified when an event happened. If the given listener is not registered, the call is ignored. Call this method when you don't need to listen events anymore.
Prevents gesture events. Prevents user from skipping between stories or clusters. Also user can't pause or close cluster by gestures. Note that Android back button still works for closing and automatic skipping still works on story duration end. If you want to prevent this, use combination of
Gestures should enable by calling
enableGesturesafter calling this method. Otherwise
AdvStorydoesn't respond gestures anymore.
Allows gesture events if disabled.
Hides header, footer and story indicator. When gestures are not disabled, user can show hidden widgets by tapping screen.
Shows header, footer and story indicator.
Pauses the current story, this stops the timer and the story will not skip to the next content. Pauses the video if current content is a
VideoContent. When gestures are not disabled, user can resume by tapping screen.
Resumes the current story, this starts the timer from last position and the story skips as usual. Resumes the video if current content is a
Jumps to the content at the given position.
Skips to the next content if available. Otherwise skips to the next story or closes the story view.
Skips to the previous content if available. Otherwise skips to the previous story or does nothing.
Skips to the next story if available, otherwise closes the story view.
Skips to the previous story if available, otherwise does nothing.
Useful when you want to extend AdvStory media load strategy. By default, [AdvStory] loads previous and next contents media in the background.