I'm new to Dart and I'm having trouble getting started with the js-interop library. I want to add a slider from jquery ui to my page, but I cannot figure out how to do the slider() setup call from Dart. Is js-interop the correct way of doing this? Some help with this would be much appreciated.
void main() {
js.scoped(() {
var slider = query('#slider-range');
var options = js.map({
'range': true,
'values': [ 17, 67 ]
});
// This doesn't work. Element has no method named slider.
slider.slider(options);
// In javascript it's done like this:
// $( "#slider-range" ).slider({
// range: true,
// values: [ 17, 67 ]
// });
// This alert works.
js.context.alert('Hello from Dart via JS');
});
}