showDesktopPopup static method

dynamic showDesktopPopup({
  1. TencentCloudChatPopupOperationKey? operationKey,
  2. required BuildContext context,
  3. required Widget child(
    1. VoidCallback closeFunc
    ),
  4. double? width,
  5. double? height,
  6. Offset? offset,
  7. String? initText,
  8. BorderRadius? borderRadius,
  9. bool? isDarkBackground,
  10. String? title,
  11. VoidCallback? onSubmit,
  12. Widget? submitWidget,
  13. VoidCallback? onConfirm,
  14. VoidCallback? onCancel,
})

Implementation

static showDesktopPopup({
  TencentCloudChatPopupOperationKey? operationKey,
  required BuildContext context,
  required Widget Function(VoidCallback closeFunc) child,
  double? width,
  double? height,
  Offset? offset,
  String? initText,
  BorderRadius? borderRadius,
  bool? isDarkBackground,
  String? title,
  VoidCallback? onSubmit,
  Widget? submitWidget,
  VoidCallback? onConfirm,
  VoidCallback? onCancel,
}) async {
  final bool? res = await _showDesktopPopupFunc?.call(
    context: context,
    child: child,
    width: width,
    height: height,
    offset: offset,
    initText: initText,
    borderRadius: borderRadius,
    isDarkBackground: isDarkBackground,
    title: title,
    onSubmit: onSubmit,
    submitWidget: submitWidget,
    onConfirm: onConfirm,
    onCancel: onCancel,
  );
  if (res != true) {
    TencentCloudChatDesktopPopup.showPopupWindow(
      operationKey: operationKey ?? TencentCloudChatPopupOperationKey.custom,
      context: context,
      child: child,
      width: width,
      height: height,
      offset: offset,
      initText: initText,
      borderRadius: borderRadius,
      isDarkBackground: isDarkBackground = true,
      title: title,
      onSubmit: onSubmit,
      submitWidget: submitWidget,
      onConfirm: onConfirm,
      onCancel: onCancel,
    );
  }
}