ActivityRecord.fromJson constructor

ActivityRecord.fromJson(
  1. Map<String, dynamic> json
)

Deserializes a JSON-compatible map to create an instance.

Used internally, not intended for direct use by consumers. The expected map structure may change without notice.

Implementation

factory ActivityRecord.fromJson(final Map<String, dynamic> json) {
  return ActivityRecord(
    shortDescription: json['shortDescription'],
    longDescription: json['longDescription'],
    sportType: SportTypeExtension.fromId(json['sportType']),
    effortType: EffortTypeExtension.fromId(json['effortType']),
    bikeProfile: BikeProfileElectricBikeProfile.fromJson(json['bikeProfile']),
    visibility: ActivityVisibilityExtension.fromId(json['visibility']),
  );
}