fromCompatibleFormat static method

HollisticMatchScoutingData fromCompatibleFormat(
  1. String rawData
)

Implementation

static HollisticMatchScoutingData fromCompatibleFormat(
    String rawData) {
  Debug().info("Decoding a hollistic match scouting data...");
  final Map<dynamic, dynamic> data =
      jsonDecode(rawData) as Map<dynamic, dynamic>;
  PrelimInfo prelim =
      PrelimInfo.fromCompatibleFormat(data["prelim"].toString());
  return HollisticMatchScoutingData(
    comments: data.containsKey("cmt")
        ? CommentsInfo.fromCompatibleFormat(data["cmt"].toString())
        : CommentsInfo.optional(
            associatedId: data["id"].toString(),
            matchNumber: prelim.matchNumber,
            teamNumber: prelim.teamNumber),
    preliminary: prelim,
    auto: AutoInfo.fromCompatibleFormat(data["auto"].toString()),
    teleop:
        TeleOpInfo.fromCompatibleFormat(data["tele"].toString()),
    endgame:
        EndgameInfo.fromCompatibleFormat(data["end"].toString()),
    misc: MiscInfo.fromCompatibleFormat(data["misc"].toString()),
    id: data["id"].toString(),
  );
}