getFileSize method

int getFileSize(
  1. dynamic file
)

Returns the file size depending on whether it's Uint8List or File.

Implementation

int getFileSize(dynamic file) {
  if (file is Uint8List) {
    return file.length;
  }
  if (file is File) {
    return file.lengthSync();
  }
  throw FileTypeError();
}