shareMediaMusic method

  1. @override
Future<void> shareMediaMusic({
  1. required int scene,
  2. String? title,
  3. String? description,
  4. Uint8List? thumbData,
  5. String? musicUrl,
  6. String? musicDataUrl,
  7. String? musicLowBandUrl,
  8. String? musicLowBandDataUrl,
})
override

分享 - 音乐

Implementation

@override
Future<void> shareMediaMusic({
  required int scene,
  String? title,
  String? description,
  Uint8List? thumbData,
  String? musicUrl,
  String? musicDataUrl,
  String? musicLowBandUrl,
  String? musicLowBandDataUrl,
}) {
  assert(title == null || title.length <= 512);
  assert(description == null || description.length <= 1024);
  assert(thumbData == null || thumbData.lengthInBytes <= 32 * 1024);
  assert(
    (musicUrl != null && musicUrl.length <= 10 * 1024) ||
        (musicLowBandUrl != null && musicLowBandUrl.length <= 10 * 1024),
  );
  return methodChannel.invokeMethod<void>(
    'shareMusic',
    <String, dynamic>{
      'scene': scene, // Scene
      if (title != null) 'title': title,
      if (description != null) 'description': description,
      if (thumbData != null) 'thumbData': thumbData,
      if (musicUrl != null) 'musicUrl': musicUrl,
      if (musicDataUrl != null) 'musicDataUrl': musicDataUrl,
      if (musicLowBandUrl != null) 'musicLowBandUrl': musicLowBandUrl,
      if (musicLowBandDataUrl != null)
        'musicLowBandDataUrl': musicLowBandDataUrl,
    },
  );
}