list method

  1. @override
Future<List<XScreenSource>> list({
  1. required Set<String> allowedDisplayIds,
  2. required Set<String> allowedWindowIds,
  3. int thumbnailWidth = 320,
  4. int thumbnailHeight = 180,
})
override

The allowed sources present right now, each with a thumbnailWidth × thumbnailHeight aspect-fit PNG.

A source whose thumbnail fails to render comes back with a null XScreenSource.thumbnailPng; thumbnail_failed is thrown only when no requested source renders at all.

Both dimensions must be between 1 and 4096, or this throws ArgumentError without reaching the platform.

Implementation

@override
Future<List<XScreenSource>> list({
  required Set<String> allowedDisplayIds,
  required Set<String> allowedWindowIds,
  int thumbnailWidth = 320,
  int thumbnailHeight = 180,
}) async {
  _requireSupported();
  listCalls.add((
    allowedDisplayIds: allowedDisplayIds,
    allowedWindowIds: allowedWindowIds,
    thumbnailWidth: thumbnailWidth,
    thumbnailHeight: thumbnailHeight,
  ));
  final err = listError;
  if (err != null) throw err;
  return List.unmodifiable(sources);
}