getDecryptedDataFromFile static method

Future<Uint8List?> getDecryptedDataFromFile(
  1. Uri fileUri
)

Returns decrypted byte data from the specified file at fileUri.

If the SDK was initialized with encryption settings, this method decrypts the file. Otherwise, it returns the file contents as-is.

Due to internal Flutter logic, the data is copied during the transition from the native part. That multiplies resource consumption and can create heavy load on the system, in case of decrypting large files. So while it is possible to use it with any file, you are responsible for preventing system overload while decrypting large files.

Implementation

static Future<Uint8List?> getDecryptedDataFromFile(Uri fileUri) async {
  try {
    return await channel
        .invokeMethod('getDecryptedDataFromFile', {'fileUri': fileUri.path});
  } catch (e) {
    Logger.root.severe(e);
    rethrow;
  }
}