飞镖:添加到新列表

时间:2020-04-27 19:34:47

标签: list dart add

我如何将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() ?? []

0 个答案:

没有答案