main
1import 'package:flutter/material.dart';
2import 'package:health_data_store/health_data_store.dart';
3
4/// Information about a straight horizontal line through the graph.
5///
6/// Can be used to indicate value ranges and provide a frame of reference to the
7/// user.
8class HorizontalGraphLine {
9 /// Create a instance from a [String] created by [toJson].
10 HorizontalGraphLine.fromJson(Map<String, dynamic> json)
11 : color = Color(json['color']),
12 height = json['height'];
13
14 /// Create information about a new horizontal line through the graph.
15 HorizontalGraphLine(this.color, this.height);
16
17 /// Color of the line.
18 Color color;
19
20 /// Height to display the line in.
21 ///
22 /// Usually on the same scale as [BloodPressureRecord]
23 int height;
24
25 /// Serialize the object to a restoreable map.
26 Map<String, dynamic> toJson() => {
27 'color': color.toARGB32(),
28 'height': height,
29 };
30}