TzdbZone1970Location constructor

TzdbZone1970Location(
  1. int latitudeSeconds,
  2. int longitudeSeconds,
  3. List<TzdbZone1970LocationCountry?>? countries,
  4. String zoneId,
  5. String comment,
)

Creates a new location.

This constructor is only for the sake of testability. Non-test code should usually obtain locations from a TzdbDateTimeZoneSource.

latitudeSeconds: Latitude of the location, in seconds. longitudeSeconds: Longitude of the location, in seconds. countries: Countries associated with this location. Must not be null, must have at least one entry, and all entries must be non-null. zoneId: Time zone identifier of the location. Must not be null. comment: Optional comment. Must not be null, but may be empty. ArgumentOutOfRangeException: The latitude or longitude is invalid.

Implementation

factory TzdbZone1970Location(
    int latitudeSeconds,
    int longitudeSeconds,
    List<TzdbZone1970LocationCountry?>? countries,
    String zoneId,
    String comment) {
  Preconditions.checkArgumentRange(
      'latitudeSeconds', latitudeSeconds, -90 * 3600, 90 * 3600);
  Preconditions.checkArgumentRange(
      'longitudeSeconds', longitudeSeconds, -180 * 3600, 180 * 3600);

  var Countries = List<TzdbZone1970LocationCountry>.unmodifiable(
      Preconditions.checkNotNull(countries, 'countries'));
  Preconditions.checkArgument(Countries.isNotEmpty, 'countries',
      "Collection must contain at least one entry");
  // for (var entry in Countries) {
  //   Preconditions.checkArgument(entry != null, 'countries', "Collection must not contain null entries");
  // }
  var ZoneId = Preconditions.checkNotNull(zoneId, 'zoneId');
  var Comment = Preconditions.checkNotNull(comment, 'comment');

  return TzdbZone1970Location._(
      Comment, Countries, latitudeSeconds, longitudeSeconds, ZoneId);
}