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()?,
  23. void onVideoTimeChange(
    1. Duration
    )?,
  24. int onVideoTimeChangeInterval = 50,
  25. void onVideoStateChange(
    1. FState,
    2. bool
    )?,
  26. int tipTime = -1,
  27. Widget? tipWidget,
  28. void onTipShow()?,
})

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()? onVideoPrepared,

  /// 视频时间更新
  final void Function(Duration)? onVideoTimeChange,

  /// 视频时间更新回调触发间隔(单位:次,每多少次位置更新触发一次回调)
  /// 默认值为50,即每50次位置更新触发一次回调
  /// 值越小回调越频繁,但会增加性能消耗
  final int onVideoTimeChangeInterval = 50,

  /// 视频状态变更
  final void Function(FState, bool)? onVideoStateChange,

  /// 试看时间(秒),0表示无需试看,-1表示免费(无限制),大于0表示试看秒数
  final int tipTime = -1,

  /// 试看结束提示Widget
  final Widget? tipWidget,

  /// 试看结束回调
  final void Function()? onTipShow,
}) {
  return (FPlayer player, FData data, BuildContext context, Size viewSize,
      Rect texturePos, Color color) {
    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,
      color: color,
      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,
      onVideoTimeChangeInterval: onVideoTimeChangeInterval,
      onVideoStateChange: onVideoStateChange,
      tipTime: tipTime,
      tipWidget: tipWidget,
      onTipShow: onTipShow,
    );
  };
}