showChaptersPanel static method

Future<void> showChaptersPanel({
  1. required BuildContext context,
  2. required List<ChapterInfo> chapters,
  3. required int currentIndex,
  4. required ValueChanged<int> onChapterSelected,
})

显示章节列表面板

context 构建上下文 chapters 章节数据列表 currentIndex 当前播放位置对应的章节索引 onChapterSelected 章节选中回调,返回选中章节索引

Implementation

static Future<void> showChaptersPanel({
  required BuildContext context,
  required List<ChapterInfo> chapters,
  required int currentIndex,
  required ValueChanged<int> onChapterSelected,
}) {
  return showRightSlidePanel<void>(
    context: context,
    width: PlayerStyles.kChaptersPanelWidth,
    panel: ChapterPanelWidget(
      chapters: chapters,
      currentIndex: currentIndex,
      onChapterSelected: onChapterSelected,
    ),
  );
}