toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() {
  // Lists cannot be automatically be generated, this is why this method is convoluted
  List<dynamic> pointsList = [];
  for (var element in super.points) {
    pointsList.add(element.toJson());
  }

  return {'points': pointsList};
}