我如何将exerciseList(标题)中的元素存储到customExercises
List customExercises = [];
// get list of custom workouts
List getAllExercisesAsStrings() {
var n;
for (n = 0; n < exerciseList.length; n++) {
customExercises.add(exerciseList[n].title);
print(customExercises);
}
return customExercises;
}
//exerciseList?.map((exercise) => exercise.title)?.toList() ?? []