cacheFile method

Future<Map?> cacheFile({
  1. required String fileID,
})

Cache files to a local directory.

Supported version: 2.0.0 and above

Description: Cache files to a local directory.

Business scenario: Save files to a local directory to improve the file opening speed next time.

Calling time: Call this API after initWithConfig.

@param fileID ID of the file to be cached @param completionBlock Callback of the file download progress and result

@return Map of the file download operation.

Implementation

Future<Map?> cacheFile({
  required String fileID,
}) async {
  var map = await _channel.invokeMethod('cacheFile', {
        'fileID': fileID,
      }) ??
      {};
  return map;
}