getFileSize method

Future<int> getFileSize(
  1. String filePath
)

Get file size in bytes

Implementation

Future<int> getFileSize(String filePath) async {
  final file = File(filePath);
  if (await file.exists()) {
    return file.length();
  }
  return 0;
}