saveVideo method

Future<AssetEntity?> saveVideo(
  1. File file, {
  2. required String? title,
  3. String? desc,
  4. String? relativePath,
})

Implementation

Future<AssetEntity?> saveVideo(
  File file, {
  required String? title,
  String? desc,
  String? relativePath,
}) async {
  if (!file.existsSync()) {
    assert(false, 'File must exists.');
    return null;
  }
  final Map<dynamic, dynamic>? result = await _channel.invokeMethod(
    PMConstants.mSaveVideo,
    <String, dynamic>{
      'path': file.absolute.path,
      'title': title,
      'desc': desc ?? '',
      'relativePath': relativePath,
      ...onlyAddPermission,
    },
  );
  if (result == null) {
    return null;
  }
  return ConvertUtils.convertMapToAsset(
    result.cast<String, dynamic>(),
    title: title,
  );
}