getDiskSpace method
获取磁盘空间信息
type 磁盘空间类型
path 要查询的路径
返回字节数,失败时返回 null
Implementation
@override
Future<int?> getDiskSpace(DiskSpaceType type, String? path) async {
try {
final result = await methodChannel.invokeMethod<int>('getDiskSpace', {
'type': type.name,
'path': path,
});
return result;
} catch (e) {
if (kDebugMode) {
print('DiskUsage: Failed to get disk space: $e');
}
return null;
}
}