queryEntities method

Future<List<Map<String, Object?>>> queryEntities(
  1. String method,
  2. Map<String, Object?> args, {
  3. bool background = false,
})

Answers an entity query the way the system does.

method is one of entities.byIds, entities.matching, entities.suggested, and args carries type plus whatever that method needs — the same shape the native side sends.

Implementation

Future<List<Map<String, Object?>>> queryEntities(
  String method,
  Map<String, Object?> args, {
  bool background = false,
}) {
  final handler = background ? _backgroundEntities : _entities;
  if (handler == null) {
    throw StateError(
      'No entity handler installed. Call OsIntents.install().',
    );
  }
  return handler(method, args);
}