mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Almost everything is nullable in the Log
This commit is contained in:
@@ -40,10 +40,10 @@ class Log {
|
||||
late int routineId;
|
||||
|
||||
@JsonKey(required: true)
|
||||
late int iteration;
|
||||
int? iteration;
|
||||
|
||||
@JsonKey(required: true, name: 'slot_entry')
|
||||
late int slotEntryId;
|
||||
int? slotEntryId;
|
||||
|
||||
@JsonKey(required: false)
|
||||
String? rir;
|
||||
@@ -52,10 +52,10 @@ class Log {
|
||||
String? rirTarget;
|
||||
|
||||
@JsonKey(required: true, fromJson: stringToNum, name: 'repetitions')
|
||||
late num? repetitions;
|
||||
num? repetitions;
|
||||
|
||||
@JsonKey(required: true, fromJson: stringToNum, name: 'repetitions_target')
|
||||
late num? repetitionsTarget;
|
||||
num? repetitionsTarget;
|
||||
|
||||
@JsonKey(required: true, name: 'repetitions_unit')
|
||||
late int repetitionsUnitId;
|
||||
@@ -64,10 +64,10 @@ class Log {
|
||||
late RepetitionUnit repetitionsUnitObj;
|
||||
|
||||
@JsonKey(required: true, fromJson: stringToNum, toJson: numToString)
|
||||
late num weight;
|
||||
late num? weight;
|
||||
|
||||
@JsonKey(required: true, fromJson: stringToNum, toJson: numToString, name: 'weight_target')
|
||||
late num? weightTarget;
|
||||
num? weightTarget;
|
||||
|
||||
@JsonKey(required: true, name: 'weight_unit')
|
||||
late int weightUnitId;
|
||||
@@ -81,15 +81,15 @@ class Log {
|
||||
Log({
|
||||
this.id,
|
||||
required this.exerciseId,
|
||||
required this.iteration,
|
||||
required this.slotEntryId,
|
||||
this.iteration,
|
||||
this.slotEntryId,
|
||||
required this.routineId,
|
||||
required this.repetitions,
|
||||
this.repetitions,
|
||||
this.repetitionsTarget,
|
||||
required this.repetitionsUnitId,
|
||||
required this.rir,
|
||||
this.rirTarget,
|
||||
required this.weight,
|
||||
this.weight,
|
||||
this.weightTarget,
|
||||
required this.weightUnitId,
|
||||
required this.date,
|
||||
|
||||
@@ -27,8 +27,8 @@ Log _$LogFromJson(Map<String, dynamic> json) {
|
||||
return Log(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
exerciseId: (json['exercise'] as num).toInt(),
|
||||
iteration: (json['iteration'] as num).toInt(),
|
||||
slotEntryId: (json['slot_entry'] as num).toInt(),
|
||||
iteration: (json['iteration'] as num?)?.toInt(),
|
||||
slotEntryId: (json['slot_entry'] as num?)?.toInt(),
|
||||
routineId: (json['routine'] as num).toInt(),
|
||||
repetitions: stringToNum(json['repetitions'] as String?),
|
||||
repetitionsTarget: stringToNum(json['repetitions_target'] as String?),
|
||||
|
||||
Reference in New Issue
Block a user