shareContent method

  1. @override
Future<bool> shareContent({
  1. required String content,
  2. String? subject,
  3. String? title,
})
override

Share content with the given parameters

Implementation

@override
Future<bool> shareContent({
  required String content,
  String? subject,
  String? title,
}) async {
  if (!isSupported) {
    throw UnsupportedError(
      'Sharing not supported on this platform',
    );
  }

  try {
    if (PlatformDetector.isWasm) {
      // Use web-based sharing for WASM
      return await _shareViaWeb(content, subject, title);
    } else {
      // Use native sharing for other platforms
      return await _shareViaNative(content, subject, title);
    }
  } catch (e) {
    debugPrint('Sharing failed: $e');
    return false;
  }
}