get method

Future<List<BookmarkTreeNode>> get(
  1. Object idOrIdList
)

Retrieves the specified BookmarkTreeNode(s). idOrIdList A single string-valued id, or an array of string-valued ids

Implementation

Future<List<BookmarkTreeNode>> get(Object idOrIdList) async {
  var $res = await promiseToFuture<JSArray>(
      $js.chrome.bookmarks.get(switch (idOrIdList) {
    String() => idOrIdList.jsify()!,
    List() => idOrIdList.toJSArrayString(),
    _ => throw UnsupportedError(
        'Received type: ${idOrIdList.runtimeType}. Supported types are: String, List<String>')
  }));
  return $res.toDart
      .cast<$js.BookmarkTreeNode>()
      .map((e) => BookmarkTreeNode.fromJS(e))
      .toList();
}