feat:增加记录对话框内容
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Health {
|
||||
class HealthRecord {
|
||||
@JsonKey(name: 'id')
|
||||
int? id;
|
||||
|
||||
@@ -9,10 +11,10 @@ class Health {
|
||||
String? sportProject;
|
||||
|
||||
@JsonKey(name: 'sportDuration')
|
||||
int? sportDuration;
|
||||
num? sportDuration;
|
||||
|
||||
@JsonKey(name: 'weight')
|
||||
int? weight;
|
||||
num? weight;
|
||||
|
||||
@JsonKey(name: 'sleepStartTime')
|
||||
String? sleepStartTime;
|
||||
@@ -21,12 +23,12 @@ class Health {
|
||||
String? sleepEndTime;
|
||||
|
||||
@JsonKey(name: 'sleepDuration')
|
||||
int? sleepDuration;
|
||||
num? sleepDuration;
|
||||
|
||||
@JsonKey(name: 'date')
|
||||
String date;
|
||||
|
||||
Health({
|
||||
|
||||
HealthRecord({
|
||||
this.id,
|
||||
this.sportProject,
|
||||
this.sportDuration,
|
||||
@@ -34,10 +36,22 @@ class Health {
|
||||
this.sleepStartTime,
|
||||
this.sleepEndTime,
|
||||
this.sleepDuration,
|
||||
required this.date
|
||||
required this.date,
|
||||
});
|
||||
|
||||
// factory Health.fromJson(Map<String, dynamic> json) => _$HealthFromJson(json);
|
||||
//
|
||||
// Map<String, dynamic> toJson() => _$HealthToJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum RecordType {
|
||||
weight('体重', FontAwesomeIcons.weightScale, Color(0xFFF59E0B)),
|
||||
sport('运动', FontAwesomeIcons.personRunning, Color(0xFF38BDF8)),
|
||||
sleep('睡眠', FontAwesomeIcons.moon, Color(0xFF10B981));
|
||||
|
||||
final String title;
|
||||
final IconData icon;
|
||||
final Color color;
|
||||
|
||||
const RecordType(this.title, this.icon, this.color);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user