Skip to content

Commit

Permalink
Release 1.7.0 (#198)
Browse files Browse the repository at this point in the history
* Change text for the variable 'possibleWalkDistance'. (#196)

* Hotfix/patientlist update (#193)

* Bugfix with Update the Cards

* Code refactoring (1.round)

* Bugfix with patient profile

* Change drops until 50 (#194)

* Change drops until 50

* Bugfix with (0 1/2)

* Change switches in patient profile to be grayed out. (#192)

* Update pubspec.yaml (#197)
  • Loading branch information
FaysalSolutions authored Oct 6, 2023
1 parent 7e8d41e commit 98b6f34
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 105 deletions.
2 changes: 1 addition & 1 deletion lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"selectDate": "Datum auswählen",
"editTherapy": "Therapie bearbeiten",
"bodyWeight": "Körpergewicht",
"possibleWalkDistance": "Mögliche Gehstrecke innerhalb von 2 Minuten",
"possibleWalkDistance": "Mögliche Gehstrecke innerhalb von 2 Minuten (Meter)",
"hrs": "Std.",
"autoCalc": "(autom. Berechnung)",
"sleepQuality7Days": "Schlafqualität während der letzten 7 Tage",
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@
"@bodyWeight": {
"description": "Body weight"
},
"possibleWalkDistance": "Possible walking distance within 2 minutes",
"possibleWalkDistance": "Possible walking distance within 2 minutes (meters)",
"@possibleWalkDistance": {
"description": "Possible walking distance within 2 minutes"
},
Expand Down
29 changes: 19 additions & 10 deletions lib/models/medication.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,24 @@ class Medication extends AbstractDatabaseObject {
final String compound;

/// All possible amount values.
static const Map<String, String> selection = <String, String>{
'0': '0',
'1/2': '1/2',
'1': '1',
'1 1/2': '1 1/2',
'2': '2',
'2 1/2': '2 1/2',
'3': '3',
};
static final Map<String, String> selection = createSelection(50);

/// Generates a map from 0 to [upperLimit], including half values,
/// represented as strings.
static Map<String, String> createSelection(int upperLimit) {
Map<String, String> selection = <String, String>{};

for (double i = 0; i <= upperLimit; i += 0.5) {
if (i == i.toInt()) {
selection[i.toInt().toString()] = i.toInt().toString();
} else {
String value = i == 0.5 ? '1/2' : '${i.toInt()} 1/2';
selection[value] = value;
}
}

return selection;
}

@override
get table {
Expand Down Expand Up @@ -113,7 +122,7 @@ class Medication extends AbstractDatabaseObject {
String intValue = values[0];
String half = '0';
if (values.length > 1) {
half = values[1];
half = values[1];
}

if (intValue == '0' && half != '0') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import 'package:picos/widgets/picos_switch.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:picos/widgets/picos_text_area.dart';

import '../../menu_screen/edit_patient_screen.dart';
import '../catalog_of_items_page.dart';
import '../widgets/catalog_of_items_label.dart';

Expand Down Expand Up @@ -317,6 +318,7 @@ class _MovementDataPageState extends State<MovementDataPage> {
initialValue: widget.initialPatientID,
onChanged: (String value) {
widget.patientIDCallback(value);
EditPatientScreen.patientID = value;
},
),
CatalogOfItemsLabel(AppLocalizations.of(context)!.caseNumber),
Expand All @@ -325,6 +327,7 @@ class _MovementDataPageState extends State<MovementDataPage> {
initialValue: widget.initialCaseNumber,
onChanged: (String value) {
widget.caseNumberCallback(value);
EditPatientScreen.caseNumber = value;
},
),
CatalogOfItemsLabel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,23 @@ class _ConfigurationPages extends State<ConfigurationPages> {
'entryBloodPressureEnabled': false,
'entryBloodSugarLevelsEnabled': false,
'entryHeartFrequencyEnabled': false,
'entryWeightBMIEnabled': false,
'entryWeightBMIEnabled': true,
};

final Map<String, bool> _medicationAndTherapyEntries = <String, bool>{
'entryDoctorsVisitEnabled': false,
'entryMedicationEnabled': false,
'entryTherapyEnabled': false,
'entryDoctorsVisitEnabled': true,
'entryMedicationEnabled': true,
'entryTherapyEnabled': true,
};

final Map<String, bool> _bodyAndMindEntries = <String, bool>{
'entryPainEnabled': false,
'entryPhq4Enabled': false,
'entryPainEnabled': true,
'entryPhq4Enabled': true,
};

final Map<String, bool> _activityAndRestEntries = <String, bool>{
'entrySleepDurationEnabled': false,
'entrySleepQualityEnabled': false,
'entrySleepDurationEnabled': true,
'entrySleepQualityEnabled': true,
'entryWalkDistanceEnabled': false,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,17 @@ class _ConfigurationActivityAndRestState
),
SwitchListTile(
value: _entrySleepDurationEnabled,
onChanged: (bool value) {
setState(() {
widget.callbackActivityAndRest(
'entrySleepDurationEnabled',
value,
);
_entrySleepDurationEnabled = value;
});
},
onChanged: _entrySleepDurationEnabled
? null
: (bool value) {
setState(() {
widget.callbackActivityAndRest(
'entrySleepDurationEnabled',
value,
);
_entrySleepDurationEnabled = value;
});
},
secondary: const Icon(Icons.access_alarm_outlined),
title: Text(
AppLocalizations.of(context)!.sleepDuration,
Expand All @@ -114,15 +116,17 @@ class _ConfigurationActivityAndRestState
),
SwitchListTile(
value: _entrySleepQualityEnabled,
onChanged: (bool value) {
setState(() {
widget.callbackActivityAndRest(
'entrySleepQualityEnabled',
value,
);
_entrySleepQualityEnabled = value;
});
},
onChanged: _entrySleepQualityEnabled
? null
: (bool value) {
setState(() {
widget.callbackActivityAndRest(
'entrySleepQualityEnabled',
value,
);
_entrySleepQualityEnabled = value;
});
},
secondary: const Icon(Icons.bed_outlined),
title: Text(
AppLocalizations.of(context)!.sleepQuality,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,17 @@ class _ConfigurationBodyAndMindState extends State<ConfigurationBodyAndMind> {
),
SwitchListTile(
value: _entryPainEnabled,
onChanged: (bool value) {
setState(() {
widget.callbackBodyAndMind(
'entryPainEnabled',
value,
);
_entryPainEnabled = value;
});
},
onChanged: _entryPainEnabled
? null
: (bool value) {
setState(() {
widget.callbackBodyAndMind(
'entryPainEnabled',
value,
);
_entryPainEnabled = value;
});
},
secondary: const Icon(Icons.mood_bad_outlined),
title: Text(
AppLocalizations.of(context)!.pain,
Expand All @@ -87,15 +89,17 @@ class _ConfigurationBodyAndMindState extends State<ConfigurationBodyAndMind> {
),
SwitchListTile(
value: _entryPhq4Enabled,
onChanged: (bool value) {
setState(() {
widget.callbackBodyAndMind(
'entryPhq4Enabled',
value,
);
_entryPhq4Enabled = value;
});
},
onChanged: _entryPhq4Enabled
? null
: (bool value) {
setState(() {
widget.callbackBodyAndMind(
'entryPhq4Enabled',
value,
);
_entryPhq4Enabled = value;
});
},
secondary: const Icon(Icons.psychology_outlined),
title: const Text(
'PHQ-4',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ class _ConfigurationMedicationAndTherapyState
),
SwitchListTile(
value: _entryMedicationEnabled,
onChanged: (bool value) {
setState(() {
widget.callbackMedicationAndTherapy(
'entryMedicationEnabled',
value,
);
_entryMedicationEnabled = value;
});
},
onChanged: _entryMedicationEnabled
? null
: (bool value) {
setState(() {
widget.callbackMedicationAndTherapy(
'entryMedicationEnabled',
value,
);
_entryMedicationEnabled = value;
});
},
secondary: const Icon(Icons.medication),
title: Text(
AppLocalizations.of(context)!.medication,
Expand All @@ -93,15 +95,17 @@ class _ConfigurationMedicationAndTherapyState
),
SwitchListTile(
value: _entryTherapyEnabled,
onChanged: (bool value) {
setState(() {
widget.callbackMedicationAndTherapy(
'entryTherapyEnabled',
value,
);
_entryTherapyEnabled = value;
});
},
onChanged: _entryTherapyEnabled
? null
: (bool value) {
setState(() {
widget.callbackMedicationAndTherapy(
'entryTherapyEnabled',
value,
);
_entryTherapyEnabled = value;
});
},
secondary: const Icon(Icons.healing_outlined),
title: Text(
AppLocalizations.of(context)!.therapy,
Expand All @@ -115,15 +119,17 @@ class _ConfigurationMedicationAndTherapyState
),
SwitchListTile(
value: _entryDoctorsVisitEnabled,
onChanged: (bool value) {
setState(() {
widget.callbackMedicationAndTherapy(
'entryDoctorsVisitEnabled',
value,
);
_entryDoctorsVisitEnabled = value;
});
},
onChanged: _entryDoctorsVisitEnabled
? null
: (bool value) {
setState(() {
widget.callbackMedicationAndTherapy(
'entryDoctorsVisitEnabled',
value,
);
_entryDoctorsVisitEnabled = value;
});
},
secondary: const Icon(Icons.local_hospital_outlined),
title: Text(
AppLocalizations.of(context)!.doctorsVisit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ class _ConfigurationVitalValuesState extends State<ConfigurationVitalValues> {
),
SwitchListTile(
value: _entryWeightBMIEnabled,
onChanged: (bool value) {
setState(() {
widget.callbackVitalValues(
'entryWeightBMIEnabled',
value,
);
_entryWeightBMIEnabled = value;
});
},
onChanged: _entryWeightBMIEnabled
? null
: (bool value) {
setState(() {
widget.callbackVitalValues(
'entryWeightBMIEnabled',
value,
);
_entryWeightBMIEnabled = value;
});
},
secondary: const Icon(Icons.monitor_weight_outlined),
title: Text(
AppLocalizations.of(context)!.weightBMI,
Expand Down
Loading

0 comments on commit 98b6f34

Please sign in to comment.