forId method

  1. @override
Future<DateTimeZone> forId(
  1. String id
)
override

Returns the time zone definition associated with the given ID.

Note that this is permitted to return a DateTimeZone that has a different ID to that requested, if the ID provided is an alias.

Note also that this method is not required to return the same DateTimeZone instance for successive requests for the same ID; however, all instances returned for a given ID must compare as equal.

It is advised that sources should document their behaviour regarding any fixed-offset timezones (i.e. 'UTC' and "UTC+/-Offset") that are included in the list returned by getIds. (These IDs will not be requested by DateTimeZoneCache, but any users calling into the source directly may care.)

The source need not attempt to cache time zones; caching is typically provided by DateTimeZoneCache.

id: The ID of the time zone to return. This must be one of the IDs returned by getIds. Returns: The DateTimeZone for the given ID. ArgumentException: id is not supported by this source.

Implementation

@override
Future<DateTimeZone> forId(String id) async => (await _tzdbIndexAsync).getTimeZone(id);