loadPkpassFileAsBase64 static method

Future<String> loadPkpassFileAsBase64({
  1. required String path,
})

Reads a PKPass file from the local filesystem at the given path and returns its contents encoded as a base64 string.

The path parameter is the full file path to the PKPass file.

Returns a Future that completes with the base64-encoded string, which can be used, for example, to pass the data to a plugin.

Throws an IOException if the file is not found or cannot be read.

Implementation

static Future<String> loadPkpassFileAsBase64({required String path}) async {
  final bytes = await File(path).readAsBytes();
  return base64Encode(bytes);
}