duration method

Future<List<PrayerTime>> duration({
  1. required Zone zone,
  2. required String datestart,
  3. required String dateend,
})

A function that return specific range prayertime days The zone should be a Zone object type. The dateend should have a format 'YYYY-MM-DD'. The datestart should have a format 'YYYY-MM-DD'.

Implementation

Future<List<PrayerTime>> duration(
    {required Zone zone,
    required String datestart,
    required String dateend}) async {
  try {
    Map<dynamic, dynamic> decodedResult = await HttpService.post(
        zone: zone.code, datestart: datestart, dateend: dateend);
    return PrayerTime.getListFromJson(decodedResult);
  } catch (e) {
    throw Exception('ESolat Connector error $e');
  }
}