I am trying to learn client-side Dart, coming from a server-side Java EE world, and I am having trouble converting an array from an existing JavaScript library into a Dart List.
I am trying to learn by building on the Javascript Interop example that uses Google Maps. In Google's Maps API's documentation, the DirectionsLeg object's step property returns.
array of DirectionsSteps, each of which contains information about the individual steps in this leg
How can I convert this var into a Dart List? I have tried the following:
final List<maps.DirectionsStep> steps = List.from(directionsLeg.steps);
But Dart Editor tells me cannot resolve method 'from' in class 'List'. My imports are:
import 'dart:html';
import 'dart:core';
import 'package:js/js.dart' as js;
What am I doing wrong? Is it even possible or must I just accept using a var?