DHUTimezone class
A dart helper util class representing timezone information including the timezone name, raw offset, abbreviation, and daylight saving time (DST) offset.
- Annotations
Constructors
- DHUTimezone.new({required String timezone, required int rawOffset, required String abbreviation, required int dstOffset})
-
Creates a DHUTimezone object with the given data.
const
-
DHUTimezone.fromMap(Map<
String, dynamic> map) -
Creates a DHUTimezone object from a Map of key-value pairs.
factory
Properties
- abbreviation → String
-
The abbreviation of the timezone.
For example, "CAT" stands for Central Africa Time.
final
- dstOffset → int
-
The offset in seconds during Daylight Saving Time (DST).
For example, 0 if DST is not observed.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- rawOffset → int
-
The raw offset from UTC in seconds without considering DST.
For example, 7200 means the timezone is 2 hours ahead of UTC.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timezone → String
-
The name of the timezone in IANA format.
For example, "Africa/Maputo".
final
Methods
-
getCountries(
) → List< DHUCountry> - Returns a list of countries that use this timezone.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
byIdentifier(
String timezone, [Map< String, Map< ? rawData]) → DHUTimezone?String, dynamic> > - Gets timezone by identifier, e.g., 'Africa/Cairo'.
-
generate(
[Map< String, Map< ? rawData]) → List<String, dynamic> >DHUTimezone> - generates a list of DHUTimezone objects from raw data.