getAll method

List<Shortcut> getAll()

Implementation

List<Shortcut> getAll() {
  final list = c.native_shortcut_manager_get_all();
  final items = <Shortcut>[];
  for (var i = 0; i < list.count; i++) {
    items.add(Shortcut.fromHandle(list.shortcuts[i]));
  }
  final listPointer = pkg_ffi.calloc<c.native_shortcut_list_t>();
  listPointer.ref = list;
  // The handles now belong to `items`; free just the array.
  c.native_shortcut_list_release(listPointer);
  pkg_ffi.calloc.free(listPointer);
  return items;
}