getFileSizeMB static method

Future<double> getFileSizeMB(
  1. File file
)

Get file size in MB

Implementation

static Future<double> getFileSizeMB(File file) async {
  final bytes = await file.length();
  return bytes / (1024 * 1024);
}