I need to get the search results from Algolia on Flutter Web from JS?
This is in the index.html:
<script>
const client = algoliasearch("4HURXXXXX", "xxxxxb8fxxxx");
async function asyncTest(indexx, text, hitCallback, errorCallback) {
// Get the
const index = client.initIndex(indexx);
const res = await index.search();
return res;
}
</script>
Flutter:
import 'dart:js' as js;
js.context.callMethod('asyncTest', [
'stock_items',
searchValue,
]);
How do I get the Javsdcript promise as a Dart Future?