TimeExtent constructor

TimeExtent(
  1. {required DateTime? startTime,
  2. required DateTime? endTime}
)

Creates a time extent with the given start and end times.

Parameters:

  • startTime — The start time.
  • endTime — The end time.

Implementation

factory TimeExtent(
    {required DateTime? startTime, required DateTime? endTime}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreStartTime = startTime?.toArcGIS();
  final coreEndTime = endTime?.toArcGIS();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_TimeExtent_createWithStartAndEndTime(
        coreStartTime?._handle ?? ffi.nullptr,
        coreEndTime?._handle ?? ffi.nullptr,
        errorHandler);
  });
  final TimeExtent object = TimeExtent._withHandle(handle);
  object._startTime.cache(startTime);
  object._endTime.cache(endTime);
  return object;
}