fPanelBuilder function

FPanelWidgetBuilder fPanelBuilder({
  1. Key? key,
  2. bool fill = false,
  3. bool isVideos = false,
  4. List<VideoItem>? videoList,
  5. int videoIndex = 0,
  6. void playNextVideoFun()?,
  7. String title = '',
  8. String subTitle = '',
  9. int duration = 5000,
  10. bool doubleTap = true,
  11. bool isRightButton = false,
  12. List<Widget>? rightButtonList,
  13. bool isSnapShot = false,
  14. bool isCaption = false,
  15. Map<String, double>? speedList,
  16. bool isResolution = false,
  17. Map<String, ResolutionItem>? resolutionList,
  18. IconData settingIcon = Icons.settings,
  19. void settingFun()?,
  20. void onError()?,
  21. void onVideoEnd()?,
  22. void onVideoPrepared(
    1. Size?
    )?,
  23. void onVideoTimeChange(
    1. Duration
    )?,
})

Implementation

FPanelWidgetBuilder fPanelBuilder({
  Key? key,
  final bool fill = false,

  /// 是否展示视频列表
  final bool isVideos = false,

  /// 视频列表
  final List<VideoItem>? videoList,
  final int videoIndex = 0,

  /// 全屏点击下一集按钮事件
  final void Function()? playNextVideoFun,

  /// 视频标题
  final String title = '',

  /// 视频副标题
  final String subTitle = '',
  final int duration = 5000,
  final bool doubleTap = true,

  /// 中间区域右上方按钮是否展示
  final bool isRightButton = false,

  /// 中间区域右上方按钮Widget集合
  final List<Widget>? rightButtonList,

  /// 截屏按钮是否展示
  final bool isSnapShot = false,

  /// 字幕按钮是否展示
  final bool isCaption = false,

  /// 倍速列表,注意这里一定要包含1倍速
  final Map<String, double>? speedList,

  /// 清晰度按钮是否展示
  final bool isResolution = false,

  /// 清晰度列表
  final Map<String, ResolutionItem>? resolutionList,

  /// 设置图标
  final IconData settingIcon = Icons.settings,

  /// 设置点击事件
  final void Function()? settingFun,

  /// 视频错误点击刷新
  final void Function()? onError,

  /// 视频结束
  final void Function()? onVideoEnd,

  /// 视频完成后台任务到稳定期
  final void Function(Size?)? onVideoPrepared,

  /// 视频时间更新
  final void Function(Duration)? onVideoTimeChange,
}) {
  return (FPlayer player, FData data, BuildContext context, Size viewSize,
      Rect texturePos) {
    return _FPanel2(
      key: key,
      player: player,
      data: data,
      isVideos: isVideos,
      title: title,
      subTitle: subTitle,
      videoList: videoList,
      videoIndex: videoIndex,
      playNextVideoFun: playNextVideoFun,
      isRightButton: isRightButton,
      rightButtonList: rightButtonList,
      viewSize: viewSize,
      texPos: texturePos,
      fill: fill,
      doubleTap: doubleTap,
      isSnapShot: isSnapShot,
      hideDuration: duration,
      isCaption: isCaption,
      speedList: speedList,
      isResolution: isResolution,
      resolutionList: resolutionList,
      settingIcon: settingIcon,
      settingFun: settingFun,
      onError: onError,
      onVideoEnd: onVideoEnd,
      onVideoPrepared: onVideoPrepared,
      onVideoTimeChange: onVideoTimeChange,
    );
  };
}