getExercisesByType method

Future<Either<ApiError, List<ExerciseInfo>>> getExercisesByType(
  1. String category,
  2. String? type
)

Implementation

Future<Either<ApiError, List<ExerciseInfo>>> getExercisesByType(
        String category, String? type) =>
    get(
        "$_exercisesRoutesPrefix/by-category-and-type",
        queryParameters: {
          "exerciseCategory": category,
          if (type != null) "exerciseType": type
        },
        (json) => (json as List<dynamic>)
            .map((e) => ExerciseInfo.fromJson(e as Map<String, dynamic>))
            .toList());