LatLng.fromList constructor

LatLng.fromList(
  1. List list
)

Creates a LatLng from a list of doubles [longitude, latitude].

Implementation

factory LatLng.fromList(List<dynamic> list) {
  if (list.length != 2) {
    throw ArgumentError('List must contain exactly two values');
  }
  return LatLng(
    (list[1] as num).toDouble(), // <-- CHANGE THIS
    (list[0] as num).toDouble(), // <-- CHANGE THIS
  );
}