Files
flutter/lib/models/workouts/routine.g.dart
Roland Geider 70fba34f0c Better handling of time zones
We now send the current time zone to the server when serializing datetime objects.
This was causing entries to be saved some hours wrong or depending on the time, on
a different day.
2025-05-26 11:13:53 +02:00

41 lines
1.5 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'routine.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Routine _$RoutineFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'created', 'name', 'description', 'fit_in_week', 'start', 'end'],
);
return Routine(
id: (json['id'] as num?)?.toInt(),
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
name: json['name'] as String,
start: json['start'] == null ? null : DateTime.parse(json['start'] as String),
end: json['end'] == null ? null : DateTime.parse(json['end'] as String),
fitInWeek: json['fit_in_week'] as bool? ?? false,
description: json['description'] as String?,
days: (json['days'] as List<dynamic>?)
?.map((e) => Day.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
sessions: (json['sessions'] as List<dynamic>?)
?.map((e) => WorkoutSessionApi.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
);
}
Map<String, dynamic> _$RoutineToJson(Routine instance) => <String, dynamic>{
'created': dateToUtcIso8601(instance.created),
'name': instance.name,
'description': instance.description,
'fit_in_week': instance.fitInWeek,
'start': dateToYYYYMMDD(instance.start),
'end': dateToYYYYMMDD(instance.end),
};