execute method
Executes the method and returns a score between 0 and 100
Implementation
@override
Future<({double score, String? reason})> execute() async {
final deviceInfo = await DeviceInfoPlugin().deviceInfo;
if (deviceInfo is AndroidDeviceInfo) {
final freeRatio = deviceInfo.freeDiskSize / deviceInfo.totalDiskSize;
if (freeRatio > 0.95) {
return (
score: score,
reason: "$reason: ${(freeRatio * 100).toStringAsFixed(1)}%",
);
}
}
return (score: 0.0, reason: null);
}