toJSONArray static method

List<Map<String, dynamic>> toJSONArray(
  1. List<SensorValue> data
)

Map a list of data samples to a JSON formatted array.

Map a list of data samples to a JSON formatted array. This is particularly useful to store data to database.

Implementation

static List<Map<String, dynamic>> toJSONArray(List<SensorValue> data) =>
    List.generate(data.length, (index) => data[index].toJSON());