|
|
|
|
@ -49,28 +49,41 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
String? get mmolValue => _mmolValue;
|
|
|
|
|
|
|
|
|
|
// Store the original entered value and which field it was entered in
|
|
|
|
|
String? _originalValue;
|
|
|
|
|
String _originalUnit = 'mg/dL'; // which field the original value was entered in
|
|
|
|
|
bool _isSwapped = false; // toggle state for switch
|
|
|
|
|
|
|
|
|
|
String _activeUnit = 'mg/dL'; // current source unit
|
|
|
|
|
String get activeUnit => _activeUnit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ================== BLOOD CHOLESTEROL ==================
|
|
|
|
|
String? _cholMgdlValue;
|
|
|
|
|
String? _cholMmolValue;
|
|
|
|
|
String? _cholOriginalValue;
|
|
|
|
|
String _cholOriginalUnit = 'mg/dL';
|
|
|
|
|
bool _cholIsSwapped = false;
|
|
|
|
|
String _cholActiveUnit = 'mg/dL';
|
|
|
|
|
|
|
|
|
|
String? get cholMgdlValue => _cholMgdlValue;
|
|
|
|
|
|
|
|
|
|
String? get cholMmolValue => _cholMmolValue;
|
|
|
|
|
|
|
|
|
|
String get cholActiveUnit => _cholActiveUnit;
|
|
|
|
|
|
|
|
|
|
// ================== TRIGLYCERIDES ==================
|
|
|
|
|
String? _triMgdlValue;
|
|
|
|
|
String? _triMmolValue;
|
|
|
|
|
String? _triOriginalValue;
|
|
|
|
|
String _triOriginalUnit = 'mg/dL';
|
|
|
|
|
bool _triIsSwapped = false;
|
|
|
|
|
String _triActiveUnit = 'mg/dL';
|
|
|
|
|
|
|
|
|
|
String? get triMgdlValue => _triMgdlValue;
|
|
|
|
|
|
|
|
|
|
String? get triMmolValue => _triMmolValue;
|
|
|
|
|
String get triActiveUnit => _triActiveUnit;
|
|
|
|
|
|
|
|
|
|
String get triActiveUnit => _triActiveUnit;
|
|
|
|
|
|
|
|
|
|
// Generic helpers
|
|
|
|
|
|
|
|
|
|
@ -726,13 +739,10 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
final DateTime firstTrimesterStart = lmp;
|
|
|
|
|
final DateTime firstTrimesterEnd = lmp.add(const Duration(days: 83));
|
|
|
|
|
|
|
|
|
|
final DateTime secondTrimesterStart =
|
|
|
|
|
firstTrimesterEnd.add(const Duration(days: 1));
|
|
|
|
|
final DateTime secondTrimesterEnd =
|
|
|
|
|
lmp.add(const Duration(days: 195));
|
|
|
|
|
final DateTime secondTrimesterStart = firstTrimesterEnd.add(const Duration(days: 1));
|
|
|
|
|
final DateTime secondTrimesterEnd = lmp.add(const Duration(days: 195));
|
|
|
|
|
|
|
|
|
|
final DateTime thirdTrimesterStart =
|
|
|
|
|
secondTrimesterEnd.add(const Duration(days: 1));
|
|
|
|
|
final DateTime thirdTrimesterStart = secondTrimesterEnd.add(const Duration(days: 1));
|
|
|
|
|
final DateTime thirdTrimesterEnd = dueDate;
|
|
|
|
|
|
|
|
|
|
deliveryResult = {
|
|
|
|
|
@ -741,7 +751,7 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
// Raw DateTime (useful for logic/UI)
|
|
|
|
|
'lmpDateTime': lmp,
|
|
|
|
|
'dueDateTime': dueDate,
|
|
|
|
|
'dueDateDay' : _formatDateWithDayName(dueDate),
|
|
|
|
|
'dueDateDay': _formatDateWithDayName(dueDate),
|
|
|
|
|
// Trimester info
|
|
|
|
|
'firstTrimester': {
|
|
|
|
|
'start': _formatDate(firstTrimesterStart),
|
|
|
|
|
@ -769,7 +779,6 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Blood sugar conversions
|
|
|
|
|
void calculateBloodSugar({required String valueText, required String unit}) {
|
|
|
|
|
if (valueText.trim().isEmpty) {
|
|
|
|
|
@ -838,8 +847,6 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
'dietType': dietType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onBloodSugarChanged(String value, String fromUnit) {
|
|
|
|
|
_activeUnit = fromUnit;
|
|
|
|
|
|
|
|
|
|
@ -855,47 +862,105 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
if (fromUnit == 'mg/dL') {
|
|
|
|
|
_mgdlValue = value;
|
|
|
|
|
_mmolValue = (parsed / 18.0182).toStringAsFixed(1);
|
|
|
|
|
_mmolValue = (parsed / 18.0182).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
_mmolValue = value;
|
|
|
|
|
_mgdlValue = (parsed * 18.0182).toStringAsFixed(0);
|
|
|
|
|
_mgdlValue = (parsed * 18.0182).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void switchBloodSugarValues() {
|
|
|
|
|
if (_activeUnit == 'mg/dL') {
|
|
|
|
|
final mmol = double.tryParse(_mmolValue ?? '');
|
|
|
|
|
if (mmol == null) return;
|
|
|
|
|
void onBloodSugarMgdlChanged(String value) {
|
|
|
|
|
_mgdlValue = value;
|
|
|
|
|
_originalValue = value;
|
|
|
|
|
_originalUnit = 'mg/dL';
|
|
|
|
|
_isSwapped = false;
|
|
|
|
|
_activeUnit = 'mg/dL';
|
|
|
|
|
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
_mmolValue = null;
|
|
|
|
|
_originalValue = null;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_activeUnit = 'mmol/L';
|
|
|
|
|
final parsed = double.tryParse(value);
|
|
|
|
|
if (parsed == null) return;
|
|
|
|
|
|
|
|
|
|
// mmol stays as source
|
|
|
|
|
_mmolValue = mmol.toStringAsFixed(1);
|
|
|
|
|
_mgdlValue = (mmol * 18.0182).toStringAsFixed(0);
|
|
|
|
|
} else {
|
|
|
|
|
final mgdl = double.tryParse(_mgdlValue ?? '');
|
|
|
|
|
if (mgdl == null) return;
|
|
|
|
|
// Convert mg/dL to mmol/L
|
|
|
|
|
_mmolValue = (parsed / 18.0182).toStringAsFixed(3);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_activeUnit = 'mg/dL';
|
|
|
|
|
void onBloodSugarMmolChanged(String value) {
|
|
|
|
|
_mmolValue = value;
|
|
|
|
|
_originalValue = value;
|
|
|
|
|
_originalUnit = 'mmol/L';
|
|
|
|
|
_isSwapped = false;
|
|
|
|
|
_activeUnit = 'mmol/L';
|
|
|
|
|
|
|
|
|
|
// mg/dL stays as source
|
|
|
|
|
_mgdlValue = mgdl.toStringAsFixed(0);
|
|
|
|
|
_mmolValue = (mgdl / 18.0182).toStringAsFixed(1);
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
_mgdlValue = null;
|
|
|
|
|
_originalValue = null;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final parsed = double.tryParse(value);
|
|
|
|
|
if (parsed == null) return;
|
|
|
|
|
|
|
|
|
|
// Convert mmol/L to mg/dL
|
|
|
|
|
_mgdlValue = (parsed * 18.0182).toStringAsFixed(3);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void switchBloodSugarValues() {
|
|
|
|
|
// Toggle between two states using the original entered value
|
|
|
|
|
if (_originalValue == null || _originalValue!.isEmpty) return;
|
|
|
|
|
|
|
|
|
|
final originalParsed = double.tryParse(_originalValue!);
|
|
|
|
|
if (originalParsed == null) return;
|
|
|
|
|
|
|
|
|
|
_isSwapped = !_isSwapped;
|
|
|
|
|
|
|
|
|
|
if (_originalUnit == 'mg/dL') {
|
|
|
|
|
if (_isSwapped) {
|
|
|
|
|
// Original was in mg/dL, now treat it as mmol/L
|
|
|
|
|
_mmolValue = _originalValue; // Keep original format
|
|
|
|
|
_mgdlValue = (originalParsed * 18.0182).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
// Back to original: value in mg/dL
|
|
|
|
|
_mgdlValue = _originalValue; // Keep original format
|
|
|
|
|
_mmolValue = (originalParsed / 18.0182).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Original was in mmol/L
|
|
|
|
|
if (_isSwapped) {
|
|
|
|
|
// Now treat it as mg/dL
|
|
|
|
|
_mgdlValue = _originalValue; // Keep original format
|
|
|
|
|
_mmolValue = (originalParsed / 18.0182).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
// Back to original: value in mmol/L
|
|
|
|
|
_mmolValue = _originalValue; // Keep original format
|
|
|
|
|
_mgdlValue = (originalParsed * 18.0182).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --- NEW: Method to clear the values ---
|
|
|
|
|
void clearBloodSugar() {
|
|
|
|
|
_mgdlValue = null;
|
|
|
|
|
_mmolValue = null;
|
|
|
|
|
_originalValue = null;
|
|
|
|
|
_originalUnit = 'mg/dL';
|
|
|
|
|
_isSwapped = false;
|
|
|
|
|
_activeUnit = 'mg/dL';
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onBloodCholesterolChanged(String value, String fromUnit) {
|
|
|
|
|
_cholActiveUnit = fromUnit;
|
|
|
|
|
|
|
|
|
|
@ -911,47 +976,104 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
if (fromUnit == 'mg/dL') {
|
|
|
|
|
_cholMgdlValue = value;
|
|
|
|
|
_cholMmolValue = (parsed / 38.67).toStringAsFixed(2);
|
|
|
|
|
_cholMmolValue = (parsed / 38.67).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
_cholMmolValue = value;
|
|
|
|
|
_cholMgdlValue = (parsed * 38.67).toStringAsFixed(0);
|
|
|
|
|
_cholMgdlValue = (parsed * 38.67).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void switchBloodCholesterolValues() {
|
|
|
|
|
if (_cholActiveUnit == 'mg/dL') {
|
|
|
|
|
final mmol = double.tryParse(_cholMmolValue ?? '');
|
|
|
|
|
if (mmol == null) return;
|
|
|
|
|
void onCholesterolMgdlChanged(String value) {
|
|
|
|
|
_cholMgdlValue = value;
|
|
|
|
|
_cholOriginalValue = value;
|
|
|
|
|
_cholOriginalUnit = 'mg/dL';
|
|
|
|
|
_cholIsSwapped = false;
|
|
|
|
|
_cholActiveUnit = 'mg/dL';
|
|
|
|
|
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
_cholMmolValue = null;
|
|
|
|
|
_cholOriginalValue = null;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_cholActiveUnit = 'mmol/L';
|
|
|
|
|
final parsed = double.tryParse(value);
|
|
|
|
|
if (parsed == null) return;
|
|
|
|
|
|
|
|
|
|
_cholMmolValue = mmol.toStringAsFixed(2);
|
|
|
|
|
_cholMgdlValue = (mmol * 38.67).toStringAsFixed(0);
|
|
|
|
|
} else {
|
|
|
|
|
final mgdl = double.tryParse(_cholMgdlValue ?? '');
|
|
|
|
|
if (mgdl == null) return;
|
|
|
|
|
// Convert mg/dL to mmol/L
|
|
|
|
|
_cholMmolValue = (parsed / 38.67).toStringAsFixed(3);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_cholActiveUnit = 'mg/dL';
|
|
|
|
|
void onCholesterolMmolChanged(String value) {
|
|
|
|
|
_cholMmolValue = value;
|
|
|
|
|
_cholOriginalValue = value;
|
|
|
|
|
_cholOriginalUnit = 'mmol/L';
|
|
|
|
|
_cholIsSwapped = false;
|
|
|
|
|
_cholActiveUnit = 'mmol/L';
|
|
|
|
|
|
|
|
|
|
_cholMgdlValue = mgdl.toStringAsFixed(0);
|
|
|
|
|
_cholMmolValue = (mgdl / 38.67).toStringAsFixed(2);
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
_cholMgdlValue = null;
|
|
|
|
|
_cholOriginalValue = null;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final parsed = double.tryParse(value);
|
|
|
|
|
if (parsed == null) return;
|
|
|
|
|
|
|
|
|
|
// Convert mmol/L to mg/dL
|
|
|
|
|
_cholMgdlValue = (parsed * 38.67).toStringAsFixed(3);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void switchBloodCholesterolValues() {
|
|
|
|
|
// Toggle between two states using the original entered value
|
|
|
|
|
if (_cholOriginalValue == null || _cholOriginalValue!.isEmpty) return;
|
|
|
|
|
|
|
|
|
|
final originalParsed = double.tryParse(_cholOriginalValue!);
|
|
|
|
|
if (originalParsed == null) return;
|
|
|
|
|
|
|
|
|
|
_cholIsSwapped = !_cholIsSwapped;
|
|
|
|
|
|
|
|
|
|
if (_cholOriginalUnit == 'mg/dL') {
|
|
|
|
|
if (_cholIsSwapped) {
|
|
|
|
|
// Original was in mg/dL, now treat it as mmol/L
|
|
|
|
|
_cholMmolValue = _cholOriginalValue; // Keep original format
|
|
|
|
|
_cholMgdlValue = (originalParsed * 38.67).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
// Back to original: value in mg/dL
|
|
|
|
|
_cholMgdlValue = _cholOriginalValue; // Keep original format
|
|
|
|
|
_cholMmolValue = (originalParsed / 38.67).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Original was in mmol/L
|
|
|
|
|
if (_cholIsSwapped) {
|
|
|
|
|
// Now treat it as mg/dL
|
|
|
|
|
_cholMgdlValue = _cholOriginalValue; // Keep original format
|
|
|
|
|
_cholMmolValue = (originalParsed / 38.67).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
// Back to original: value in mmol/L
|
|
|
|
|
_cholMmolValue = _cholOriginalValue; // Keep original format
|
|
|
|
|
_cholMgdlValue = (originalParsed * 38.67).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clearBloodCholesterol() {
|
|
|
|
|
_cholMgdlValue = null;
|
|
|
|
|
_cholMmolValue = null;
|
|
|
|
|
_cholOriginalValue = null;
|
|
|
|
|
_cholOriginalUnit = 'mg/dL';
|
|
|
|
|
_cholIsSwapped = false;
|
|
|
|
|
_cholActiveUnit = 'mg/dL';
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onTriglyceridesChanged(String value, String fromUnit) {
|
|
|
|
|
_triActiveUnit = fromUnit;
|
|
|
|
|
|
|
|
|
|
@ -967,30 +1089,89 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
if (fromUnit == 'mg/dL') {
|
|
|
|
|
_triMgdlValue = value;
|
|
|
|
|
_triMmolValue = (parsed / 88.57).toStringAsFixed(2);
|
|
|
|
|
_triMmolValue = (parsed / 88.57).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
_triMmolValue = value;
|
|
|
|
|
_triMgdlValue = (parsed * 88.57).toStringAsFixed(0);
|
|
|
|
|
_triMgdlValue = (parsed * 88.57).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void onTriglyceridesMgdlChanged(String value) {
|
|
|
|
|
_triMgdlValue = value;
|
|
|
|
|
_triOriginalValue = value;
|
|
|
|
|
_triOriginalUnit = 'mg/dL';
|
|
|
|
|
_triIsSwapped = false;
|
|
|
|
|
_triActiveUnit = 'mg/dL';
|
|
|
|
|
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
_triMmolValue = null;
|
|
|
|
|
_triOriginalValue = null;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final parsed = double.tryParse(value);
|
|
|
|
|
if (parsed == null) return;
|
|
|
|
|
|
|
|
|
|
// Convert mg/dL to mmol/L
|
|
|
|
|
_triMmolValue = (parsed / 88.57).toStringAsFixed(3);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void onTriglyceridesMmolChanged(String value) {
|
|
|
|
|
_triMmolValue = value;
|
|
|
|
|
_triOriginalValue = value;
|
|
|
|
|
_triOriginalUnit = 'mmol/L';
|
|
|
|
|
_triIsSwapped = false;
|
|
|
|
|
_triActiveUnit = 'mmol/L';
|
|
|
|
|
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
_triMgdlValue = null;
|
|
|
|
|
_triOriginalValue = null;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final parsed = double.tryParse(value);
|
|
|
|
|
if (parsed == null) return;
|
|
|
|
|
|
|
|
|
|
// Convert mmol/L to mg/dL
|
|
|
|
|
_triMgdlValue = (parsed * 88.57).toStringAsFixed(3);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void switchTriglyceridesValues() {
|
|
|
|
|
if (_triActiveUnit == 'mg/dL') {
|
|
|
|
|
final mmol = double.tryParse(_triMmolValue ?? '');
|
|
|
|
|
if (mmol == null) return;
|
|
|
|
|
// Toggle between two states using the original entered value
|
|
|
|
|
if (_triOriginalValue == null || _triOriginalValue!.isEmpty) return;
|
|
|
|
|
|
|
|
|
|
_triActiveUnit = 'mmol/L';
|
|
|
|
|
_triMmolValue = mmol.toStringAsFixed(2);
|
|
|
|
|
_triMgdlValue = (mmol * 88.57).toStringAsFixed(0);
|
|
|
|
|
} else {
|
|
|
|
|
final mgdl = double.tryParse(_triMgdlValue ?? '');
|
|
|
|
|
if (mgdl == null) return;
|
|
|
|
|
final originalParsed = double.tryParse(_triOriginalValue!);
|
|
|
|
|
if (originalParsed == null) return;
|
|
|
|
|
|
|
|
|
|
_triIsSwapped = !_triIsSwapped;
|
|
|
|
|
|
|
|
|
|
_triActiveUnit = 'mg/dL';
|
|
|
|
|
_triMgdlValue = mgdl.toStringAsFixed(0);
|
|
|
|
|
_triMmolValue = (mgdl / 88.57).toStringAsFixed(2);
|
|
|
|
|
if (_triOriginalUnit == 'mg/dL') {
|
|
|
|
|
if (_triIsSwapped) {
|
|
|
|
|
// Original was in mg/dL, now treat it as mmol/L
|
|
|
|
|
_triMmolValue = _triOriginalValue; // Keep original format
|
|
|
|
|
_triMgdlValue = (originalParsed * 88.57).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
// Back to original: value in mg/dL
|
|
|
|
|
_triMgdlValue = _triOriginalValue; // Keep original format
|
|
|
|
|
_triMmolValue = (originalParsed / 88.57).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Original was in mmol/L
|
|
|
|
|
if (_triIsSwapped) {
|
|
|
|
|
// Now treat it as mg/dL
|
|
|
|
|
_triMgdlValue = _triOriginalValue; // Keep original format
|
|
|
|
|
_triMmolValue = (originalParsed / 88.57).toStringAsFixed(3);
|
|
|
|
|
} else {
|
|
|
|
|
// Back to original: value in mmol/L
|
|
|
|
|
_triMmolValue = _triOriginalValue; // Keep original format
|
|
|
|
|
_triMgdlValue = (originalParsed * 88.57).toStringAsFixed(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
@ -999,10 +1180,10 @@ class HealthCalcualtorViewModel extends ChangeNotifier {
|
|
|
|
|
void clearTriglycerides() {
|
|
|
|
|
_triMgdlValue = null;
|
|
|
|
|
_triMmolValue = null;
|
|
|
|
|
_triOriginalValue = null;
|
|
|
|
|
_triOriginalUnit = 'mg/dL';
|
|
|
|
|
_triIsSwapped = false;
|
|
|
|
|
_triActiveUnit = 'mg/dL';
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|