43 lines
843 B
Dart
43 lines
843 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
@JsonSerializable()
|
|
class Health {
|
|
@JsonKey(name: 'id')
|
|
int? id;
|
|
|
|
@JsonKey(name: 'sportProject')
|
|
String? sportProject;
|
|
|
|
@JsonKey(name: 'sportDuration')
|
|
int? sportDuration;
|
|
|
|
@JsonKey(name: 'weight')
|
|
int? weight;
|
|
|
|
@JsonKey(name: 'sleepStartTime')
|
|
String? sleepStartTime;
|
|
|
|
@JsonKey(name: 'sleepEndTime')
|
|
String? sleepEndTime;
|
|
|
|
@JsonKey(name: 'sleepDuration')
|
|
int? sleepDuration;
|
|
|
|
@JsonKey(name: 'date')
|
|
String date;
|
|
|
|
Health({
|
|
this.id,
|
|
this.sportProject,
|
|
this.sportDuration,
|
|
this.weight,
|
|
this.sleepStartTime,
|
|
this.sleepEndTime,
|
|
this.sleepDuration,
|
|
required this.date
|
|
});
|
|
|
|
// factory Health.fromJson(Map<String, dynamic> json) => _$HealthFromJson(json);
|
|
//
|
|
// Map<String, dynamic> toJson() => _$HealthToJson(this);
|
|
} |