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