storeBytes method

  1. @override
Future<void> storeBytes(
  1. String pathKey,
  2. String name,
  3. Uint8List bytes
)
override

Stores a file in the application's directory.

Implementation

@override
Future<void> storeBytes(String pathKey, String name, Uint8List bytes) async {
  try {
    final key = '$pathKey/$name';
    await filesBox.put(key, bytes);
    logger.log(_label, 'Successfully saved file $pathKey/$name');
  } catch (e, stacktrace) {
    throw CodelesslyException.fileIoException(
      message: 'Failed to save file $pathKey/$name',
      originalException: e,
      stacktrace: stacktrace,
    );
  }
}