fromBytes static method

ManifestStore? fromBytes(
  1. List<int> fileBytes,
  2. String format
)

Creates a ManifestStore from raw bytes

Implementation

static ManifestStore? fromBytes(
    final List<int> fileBytes,
    final String format,
  ) {
  // Get manifest from file bytes
  final manifestJson = getManifestJsonFromBytes(
    fileBytes: fileBytes,
    format: format,
  );

  // Check that the manifest was found
  if (manifestJson == null) {
    return null;
  }

  // Parse and return ManifestStore
  return ManifestStore.fromJson(json.decode(manifestJson));
}