diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 4d0479e6..c85f53ae 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -126,7 +126,7 @@ class _CovidDrivethruLocationState extends State { value: item, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Text(item.projectName), getCovidTestTypeImage(item)], + children: [Text(item.projectName ?? ""), getCovidTestTypeImage(item)], ), ); }).toList(), diff --git a/lib/pages/medical/my_trackers/temperature.dart b/lib/pages/medical/my_trackers/temperature.dart index 8884fe99..c745e157 100644 --- a/lib/pages/medical/my_trackers/temperature.dart +++ b/lib/pages/medical/my_trackers/temperature.dart @@ -17,6 +17,15 @@ class _TemperatureHomePageState extends State { String connectionStatus = "disconnected"; String currentTempInCelsius = "0.0"; + BluetoothDevice currentConnectedDevice; + + + @override + void dispose() { + super.dispose(); + currentConnectedDevice.disconnect(timeout: 15); + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -52,7 +61,7 @@ class _TemperatureHomePageState extends State { SizedBox( height: 50.0, ), - Text("Current Temp: $currentTempInCelsius" + "\u2103"), + Text("Current Temp: $currentTempInCelsius"), ], ), ); @@ -91,6 +100,7 @@ class _TemperatureHomePageState extends State { // Note: you must always re-discover services after disconnection! } if (state == BluetoothConnectionState.connected) { + currentConnectedDevice = element.device; List services = await element.device.discoverServices(); services.forEach((service) { if (service.serviceUuid.toString().contains("1809")) { @@ -103,6 +113,8 @@ class _TemperatureHomePageState extends State { print(event); setState(() { currentTempInCelsius = convertIntListToHex(event); + String currentTempInFahrenheit = ((num.parse(currentTempInCelsius) * 1.8) + 32).toStringAsFixed(1); + currentTempInCelsius = currentTempInCelsius + "\u2103" + " / " + currentTempInFahrenheit + "\u2109"; }); }); await characteristic.setNotifyValue(true);