mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-29 09:20:56 +01:00
This puts this code in sync with the backend and is logically better, since the translations can be displayed when needed and are not hard coded
47 lines
1.3 KiB
Dart
47 lines
1.3 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'log.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
Log _$LogFromJson(Map<String, dynamic> json) {
|
|
$checkKeys(
|
|
json,
|
|
requiredKeys: const [
|
|
'id',
|
|
'exercise_base',
|
|
'workout',
|
|
'reps',
|
|
'repetition_unit',
|
|
'weight',
|
|
'weight_unit',
|
|
'date'
|
|
],
|
|
);
|
|
return Log(
|
|
id: json['id'] as int?,
|
|
exerciseBaseId: json['exercise_base'] as int,
|
|
workoutPlan: json['workout'] as int,
|
|
reps: json['reps'] as int,
|
|
rir: json['rir'] as String?,
|
|
repetitionUnitId: json['repetition_unit'] as int,
|
|
weight: stringToNum(json['weight'] as String?),
|
|
weightUnitId: json['weight_unit'] as int,
|
|
date: DateTime.parse(json['date'] as String),
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> _$LogToJson(Log instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'exercise_base': instance.exerciseBaseId,
|
|
'workout': instance.workoutPlan,
|
|
'reps': instance.reps,
|
|
'rir': instance.rir,
|
|
'repetition_unit': instance.repetitionUnitId,
|
|
'weight': numToString(instance.weight),
|
|
'weight_unit': instance.weightUnitId,
|
|
'date': toDate(instance.date),
|
|
};
|