Excel.decodeBytes constructor

Excel.decodeBytes(
  1. List<int> data
)

Decodes an .xlsx file from a byte list.

Implementation

factory Excel.decodeBytes(List<int> data) {
  final Archive archive;
  try {
    archive = ZipDecoder().decodeBytes(data);
  } catch (e) {
    throw ExcelArchiveException(
      'Not a valid .xlsx file: the data could not be read as a ZIP archive.',
      cause: e,
    );
  }
  return _newExcel(archive);
}