readFileBytes static method

Future<Uint8List?> readFileBytes(
  1. String? filepath
)

Implementation

static Future<Uint8List?> readFileBytes(String? filepath) async {
  if (filepath == null) return null;
  try {
    // qualify file name
    if (_fileExists(filepath)) {
      File file = File(filepath);
      return await file.readAsBytes();
    }
    return null;
  } catch (e) {
    Log().exception(e,
        caller: 'platform.vm.dart => bool readFileBytes($filepath)');
    return null;
  }
}