addLocation method Null safety

dynamic addLocation(
  1. Location location
)

Update the current locations

Implementation

addLocation(Location location) {
  if (started) {
    locationCount++;
    locations.length < maxLocations
        ? locations.add(location)
        : locations.last = location;
  }
}