timestamp property
Local departure or arrival time for public transport routing.
A UTC DateTime object containing the local time at the route location. When null, the current time is used. The algorithmType determines interpretation: if PTAlgorithmType.departure, this is the desired departure time; if PTAlgorithmType.arrival, this is the desired arrival time. Only applies to RouteTransportMode.public.
The local time is a UTC DateTime object but containing the local time at the location. Use TimezoneService.getTimezoneInfoFromCoordinates to compute the correctly formatted timestamp for a specific location and time.
Default is null (current time).
Implementation
DateTime? get timestamp {
final OperationResult resultString = objectMethod(
pointerId,
'RoutePrefWrapper',
'isAutomaticTimestamp',
);
if (resultString['result']) {
return null;
}
final OperationResult timestampResult = objectMethod(
pointerId,
'RoutePrefWrapper',
'getTimestamp',
);
return DateTime.fromMillisecondsSinceEpoch(
timestampResult['result'],
isUtc: true,
);
}
Local departure or arrival time for public transport routing.
A UTC DateTime object containing the local time at the route location. When null, the current time is used. The algorithmType determines interpretation: if PTAlgorithmType.departure, this is the desired departure time; if PTAlgorithmType.arrival, this is the desired arrival time. Only applies to RouteTransportMode.public.
The local time is a UTC DateTime object but containing the local time at the location. Use TimezoneService.getTimezoneInfoFromCoordinates to compute the correctly formatted timestamp for a specific location and time.
Parameters
value: The timestamp to use, or null for current time.
Default is null (current time).
Implementation
set timestamp(final DateTime? value) {
if (value == null) {
objectMethod(
pointerId,
'RoutePrefWrapper',
'automatictimestamp',
args: true,
);
} else {
objectMethod(
pointerId,
'RoutePrefWrapper',
'automatictimestamp',
args: false,
);
objectMethod(
pointerId,
'RoutePrefWrapper',
'timestamp',
args: value.millisecondsSinceEpoch,
);
}
}