StoryReaderController class

短故事阅读器控制器

用于控制阅读器的播放、暂停、章节切换等功能

使用方式:

final controller = StoryReaderController();

StoryReaderNativeView(
  config: StoryReaderConfig(storyId: 123),
  controller: controller,
)

// 跳转到指定章节
controller.jumpToChapter(5);

// 收藏/取消收藏
controller.toggleFavorite();

Constructors

StoryReaderController()

Properties

hashCode int
The hash code for this object.
no setterinherited
isDisposed bool
是否已销毁
no setter
isInitialized bool
是否已初始化
no setter
readerId String?
阅读器ID
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
销毁控制器
getCurrentChapter() Future<int?>
获取当前章节
getProgress() Future<double?>
获取阅读进度
initialize(String readerId) → void
初始化控制器
jumpToChapter(int chapter) Future<void>
跳转到指定章节
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setFontSize(int fontSize) Future<void>
设置字体大小
toggleFavorite() Future<void>
切换收藏状态
toString() String
A string representation of this object.
inherited

Operators

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