mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-05 04:57:37 +01:00
@@ -36,7 +36,7 @@ class Set {
|
||||
late int day;
|
||||
|
||||
@JsonKey(required: true)
|
||||
int? order;
|
||||
late int order;
|
||||
|
||||
@JsonKey(required: true, defaultValue: '')
|
||||
late String comment;
|
||||
@@ -58,7 +58,7 @@ class Set {
|
||||
Set({
|
||||
required this.day,
|
||||
required this.sets,
|
||||
this.order,
|
||||
required this.order,
|
||||
});
|
||||
|
||||
Set.empty();
|
||||
|
||||
@@ -11,7 +11,7 @@ Set _$SetFromJson(Map<String, dynamic> json) {
|
||||
return Set(
|
||||
day: json['exerciseday'] as int,
|
||||
sets: json['sets'] as int,
|
||||
order: json['order'] as int?,
|
||||
order: json['order'] as int,
|
||||
)
|
||||
..id = json['id'] as int?
|
||||
..comment = json['comment'] as String? ?? '';
|
||||
|
||||
@@ -101,7 +101,7 @@ class _WorkoutDayWidgetState extends State<WorkoutDayWidget> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_sets = widget._day.sets;
|
||||
_sets.sort((a, b) => a.order!.compareTo(b.order!));
|
||||
_sets.sort((a, b) => a.order.compareTo(b.order));
|
||||
}
|
||||
|
||||
void _toggleExpanded() {
|
||||
|
||||
Reference in New Issue
Block a user