getResourceValues method

  1. @override
Future<FileResourceValues> getResourceValues(
  1. String path, {
  2. Set<FileResourceKey>? keys,
})
override

Reads the requested resource values for the item at path.

If keys is null, all supported keys are fetched.

Implementation

@override
Future<FileResourceValues> getResourceValues(String path,
    {Set<FileResourceKey>? keys}) {
  final effectiveKeys = keys ?? FileResourceKey.values.toSet();
  return _call(path, () async {
    final result = await methodChannel
        .invokeMethod<Map<Object?, Object?>>('getResourceValues', {
      'path': path,
      'keys': effectiveKeys.map((k) => k.name).toList(),
    });
    return FileResourceValues.fromMap(result ?? {});
  });
}