mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 23:42:00 +01:00
50 lines
1.1 KiB
Dart
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);
|
|
}
|