Files
flutter/lib/models/workouts/setting.dart
Roland Geider e92caa8eae More work on workout serialization
Also, it is now possible to delete workouts from the DB
2020-11-18 14:13:22 +01:00

50 lines
1.1 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
import 'package:wger/models/exercises/exercise.dart';
import 'package:wger/models/workouts//weight_unit.dart';
import 'package:wger/models/workouts/repetition_unit.dart';
part 'setting.g.dart';
@JsonSerializable()
class Setting {
@JsonKey(required: true)
final int id;
@JsonKey(required: true)
final Exercise exercise;
@JsonKey(required: true, name: 'repetition_unit')
final RepetitionUnit repetitionUnit;
@JsonKey(required: true)
final int reps;
@JsonKey(required: true)
final double weight;
@JsonKey(required: true, name: 'weight_unit')
final WeightUnit weightUnit;
@JsonKey(required: true)
final String comment;
// Generated by Server
@JsonKey(required: true)
final String repsText;
Setting({
this.id,
this.exercise,
this.repetitionUnit,
this.reps,
this.weight,
this.weightUnit,
this.comment,
this.repsText,
});
// Boilerplate
factory Setting.fromJson(Map<String, dynamic> json) => _$SettingFromJson(json);
Map<String, dynamic> toJson() => _$SettingToJson(this);
}