getTimezoneInfoTimezoneIdSync static method
Synchronously retrieves timezone information for an IANA timezone id and an UTC timestamp using local/offline data.
This lookup does not perform a network request. It is fast and suitable
for offline scenarios but may return stale information. When the method
returns null the specific error can be obtained immediately by calling
ApiErrorService.apiError.
Parameters
timezoneId: IANA timezone identifier to resolve.time: Instant to resolve (must be provided as a UTC DateTime).
Returns
- A TimezoneResult when successful, otherwise
null.
Implementation
static TimezoneResult? getTimezoneInfoTimezoneIdSync({
required final String timezoneId,
required final DateTime time,
}) {
final TimezoneResult result = TimezoneResult.create();
final OperationResult resultString = staticMethod(
'TimezoneService',
'getTimezoneInfoTimezoneIdSync',
args: <String, dynamic>{
'timezoneResult': result.pointerId,
'timezoneId': timezoneId,
'time': time.millisecondsSinceEpoch,
},
);
if (resultString['result'] != 0) {
return null;
}
return result;
}