ZegoLayout.pictureInPicture constructor

ZegoLayout.pictureInPicture({
  1. EdgeInsets? smallViewMargin,
  2. bool isSmallViewDraggable = true,
  3. bool switchLargeOrSmallViewByClick = true,
  4. ZegoViewPosition smallViewPosition = ZegoViewPosition.topRight,
  5. Size? smallViewSize,
  6. EdgeInsets? spacingBetweenSmallViews,
  7. bool isSmallViewsScrollable = true,
  8. int visibleSmallViewsCount = 3,
  9. bool showNewScreenSharingViewInFullscreenMode = true,
  10. ZegoShowFullscreenModeToggleButtonRules showScreenSharingFullscreenModeToggleButtonRules = ZegoShowFullscreenModeToggleButtonRules.showWhenScreenPressed,
})

Picture-in-Picture (PiP) layout.

Implementation

factory ZegoLayout.pictureInPicture({
  /// the margin of PIP view
  ///  todo@3.0 rename to margin
  EdgeInsets? smallViewMargin,

  /// small video view is draggable if set true in one-on-one mode
  bool isSmallViewDraggable = true,

  ///  whether you can switch view's position by clicking on the small view
  bool switchLargeOrSmallViewByClick = true,

  /// whether to hide the local View when the local camera is closed
  ZegoViewPosition smallViewPosition = ZegoViewPosition.topRight,

  /// the size of every small view
  Size? smallViewSize,

  /// the space between small views in multi-users mode
  ///  todo@3.0 rename to paddings
  EdgeInsets? spacingBetweenSmallViews,

  /// small video views is scrollable if set true in multi-users mode
  bool isSmallViewsScrollable = true,

  /// the visible small views count in multi-users mode
  /// if the value is set to -1, it will attempt to display the maximum number of views.
  int visibleSmallViewsCount = 3,

  ///
  bool showNewScreenSharingViewInFullscreenMode = true,

  ///
  ZegoShowFullscreenModeToggleButtonRules showScreenSharingFullscreenModeToggleButtonRules =
      ZegoShowFullscreenModeToggleButtonRules.showWhenScreenPressed,
}) {
  return ZegoLayoutPictureInPictureConfig(
    margin: smallViewMargin,
    isSmallViewDraggable: isSmallViewDraggable,
    switchLargeOrSmallViewByClick: switchLargeOrSmallViewByClick,
    smallViewPosition: smallViewPosition,
    smallViewSize: smallViewSize,
    spacingBetweenSmallViews: spacingBetweenSmallViews,
    isSmallViewsScrollable: isSmallViewsScrollable,
    visibleSmallViewsCount: visibleSmallViewsCount,
    showNewScreenSharingViewInFullscreenMode:
        showNewScreenSharingViewInFullscreenMode,
    showScreenSharingFullscreenModeToggleButtonRules:
        showScreenSharingFullscreenModeToggleButtonRules,
  );
}