show method

void show({
  1. required BuildContext context,
  2. required List<SharePlatform> platforms,
  3. required ShareInfoCollect shareInfoCall,
  4. required OnSocialConfig socialConfig,
  5. ShareProperties? properties,
})

显示分享弹窗 context 构建上下文 platforms 允许展示的分享平台 shareInfoCall 分享信息回调 title 组件标题

Implementation

void show({
  required BuildContext context,
  required List<SharePlatform> platforms,
  required ShareInfoCollect shareInfoCall,
  required OnSocialConfig socialConfig,
  ShareProperties? properties,
}) {
  if (!(_dialog?.isShowing ?? false)) {
    properties ??= ShareProperties();
    _dialog = YYDialog().build(context)
      ..gravity = Gravity.bottom
      ..backgroundColor = Colors.transparent
      ..barrierDismissible = false
      ..borderRadius = const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12))
      ..widget(_buildShareView(platforms, shareInfoCall, properties, socialConfig))
      ..show();
  }
}