getFileSize function

Future<int> getFileSize(
  1. String filePath
)

Implementation

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