Skip to content

Commit

Permalink
Reorder serialized data for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
FauconSpartiate committed Apr 5, 2024
1 parent 0cdaae1 commit 5335f56
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/calculations/subject.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ class Subject extends CalculationObject {
}

Map<String, dynamic> toJson() => {
"tests": tests,
"children": children,
"name": name,
"coefficient": weight,
"speakingWeight": speakingWeight,
"bonus": bonus,
"type": isGroup,
"speakingWeight": speakingWeight,
"children": children.toList(),
"tests": tests,
};
}
2 changes: 1 addition & 1 deletion lib/calculations/term.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class Term extends CalculationObject {
}

Map<String, dynamic> toJson() => {
"subjects": subjects,
"coefficient": weight,
"isExam": isExam,
"subjects": subjects.toList(),
};
}
2 changes: 1 addition & 1 deletion lib/calculations/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class Test extends CalculationObject {
}

Map<String, dynamic> toJson() => {
"name": name,
"grade1": numerator,
"grade2": denominator,
"name": name,
"coefficient": weight,
"isSpeaking": isSpeaking,
"timestamp": timestamp,
Expand Down
12 changes: 6 additions & 6 deletions lib/calculations/year.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,17 @@ class Year extends CalculationObject {
}

Map<String, dynamic> toJson() => {
"terms": terms,
"term_template": termTemplate,
"name": name,
"term_count": termCount,
"max_grade": maxGrade,
"rounding_mode": roundingMode,
"round_to": roundTo,
"validated_school_system": validatedSchoolSystem,
"validated_lux_system": validatedLuxSystem,
"validated_year": validatedYear,
"validated_section": validatedSection,
"validated_variant": validatedVariant,
"term_count": termCount,
"max_grade": maxGrade,
"rounding_mode": roundingMode,
"round_to": roundTo,
"terms": terms,
"term_template": termTemplate.toList(),
};
}

0 comments on commit 5335f56

Please sign in to comment.