From 199aefc84778d13ceabe523bf5725289fa0f2059 Mon Sep 17 00:00:00 2001 From: henrik Date: Sun, 20 Aug 2023 20:53:59 +0200 Subject: [PATCH] changes --- lib/screens/home/home.dart | 4 ---- lib/widgets/layout_elements.dart | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/screens/home/home.dart b/lib/screens/home/home.dart index 6b31b3f..2158dd1 100644 --- a/lib/screens/home/home.dart +++ b/lib/screens/home/home.dart @@ -63,7 +63,6 @@ class _HomePageState extends State { @override void dispose() { _pingDevicesTimer?.cancel(); - // print('---------timer canceled----------'); super.dispose(); } @@ -136,7 +135,6 @@ class _HomePageState extends State { /// of the devices and update the ui accordingly void _pingDevices() { checkAllDevicesStatus(); - // print('---------timer started----------'); _pingDevicesTimer = Timer.periodic(const Duration(seconds: 16), (timer) { checkAllDevicesStatus(); }); @@ -153,7 +151,6 @@ class _HomePageState extends State { /// [device] is the device to ping /// if the widget is not mounted anymore, the function will stop Future checkDeviceStatus(StorageDevice device) async { - // print('pinging device: ${device.hostName}'); bool isOnline = await pingDevice(ipAddress: device.ipAddress); if (mounted) { setState(() { @@ -248,7 +245,6 @@ class _HomePageState extends State { return RefreshIndicator( onRefresh: () async { _pingDevicesTimer?.cancel(); - // print('---------timer canceled----------'); // set online state for all devices to null because online state is not known yet for (StorageDevice device in _devices) { device.isOnline = null; diff --git a/lib/widgets/layout_elements.dart b/lib/widgets/layout_elements.dart index 8e0f294..ac7338d 100644 --- a/lib/widgets/layout_elements.dart +++ b/lib/widgets/layout_elements.dart @@ -188,8 +188,8 @@ class DeviceCard extends StatelessWidget { color: isOnline == null ? Colors.grey : isOnline! - ? Colors.green - : Colors.redAccent), + ? AppConstants.successMessageColor + : AppConstants.errorMessageColor), ) ], ))