DexcomEGVAPIURL.range constructor

DexcomEGVAPIURL.range({
  1. required DateTime startDate,
  2. required DateTime endDate,
  3. required bool isSandbox,
})

Generates a DexcomEGVAPIURL to get DexcomEGVData from a specific startDate to a specific endDate.

Implementation

factory DexcomEGVAPIURL.range({required DateTime startDate, required DateTime endDate, required bool isSandbox}) {
  String startDateStr = Formats.fullDateFormat.format(startDate);
  String endDateStr = Formats.fullDateFormat.format(endDate);
  return DexcomEGVAPIURL(
    url: '${_getBaseURL(isSandbox)}startDate=$startDateStr&endDate=$endDateStr',
    isSandbox: isSandbox
  );
}