getRecords method
Implementation
Future<List<MealRecordModel>?> getRecords({
required DateTime from,
required DateTime to,
}) async {
try {
final result = await _client.listMealRecords(
from: from,
to: to,
);
final records = result.data
?.map(
(e) => _convertToMealRecordDto.exec(
mealRecord: e,
),
)
.toList();
return records;
} on DioException catch (error, stackTrace) {
throw await _dioErrorHandler.handleDioError(
error,
stackTrace,
{
'from': from.toString(),
'to': to.toString(),
},
);
} catch (error, stackTrace) {
throw _repositoryErrorHandler.handleUnknownError(error, stackTrace);
}
}