From 978e77c167d0fd43b0f0d7c1bdaaa40f432a2dd9 Mon Sep 17 00:00:00 2001 From: mohammad Date: Tue, 8 Oct 2024 10:27:05 +0300 Subject: [PATCH] remove socket from water heater --- lib/features/devices/bloc/one_touch_bloc/one_touch_bloc.dart | 3 ++- .../devices/bloc/water_heater_bloc/water_heater_bloc.dart | 2 +- .../devices/bloc/water_leak_bloc/water_leak_bloc.dart | 3 ++- .../view/widgets/water_leak/water_leak_records_screen.dart | 5 ++--- .../devices/view/widgets/water_leak/water_leak_screen.dart | 3 --- lib/services/api/devices_api.dart | 5 +---- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/features/devices/bloc/one_touch_bloc/one_touch_bloc.dart b/lib/features/devices/bloc/one_touch_bloc/one_touch_bloc.dart index 1d431e9..313c2aa 100644 --- a/lib/features/devices/bloc/one_touch_bloc/one_touch_bloc.dart +++ b/lib/features/devices/bloc/one_touch_bloc/one_touch_bloc.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:firebase_database/firebase_database.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart'; import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_state.dart'; @@ -527,7 +528,7 @@ class OneTouchBloc extends Bloc { oneTouchId, ); } else { - print('Invalid statusSelected or optionSelected'); + debugPrint('Invalid statusSelected or optionSelected'); } } on DioException catch (e) { final errorData = e.response!.data; diff --git a/lib/features/devices/bloc/water_heater_bloc/water_heater_bloc.dart b/lib/features/devices/bloc/water_heater_bloc/water_heater_bloc.dart index 7d3e29d..e71f41a 100644 --- a/lib/features/devices/bloc/water_heater_bloc/water_heater_bloc.dart +++ b/lib/features/devices/bloc/water_heater_bloc/water_heater_bloc.dart @@ -74,7 +74,7 @@ class WaterHeaterBloc extends Bloc { statusModelList, ); emit(UpdateState(whModel: deviceStatus)); - _listenToChanges(); + // _listenToChanges(); } catch (e) { emit(WHFailedState(errorMessage: e.toString())); return; diff --git a/lib/features/devices/bloc/water_leak_bloc/water_leak_bloc.dart b/lib/features/devices/bloc/water_leak_bloc/water_leak_bloc.dart index c281cf1..a380b9c 100644 --- a/lib/features/devices/bloc/water_leak_bloc/water_leak_bloc.dart +++ b/lib/features/devices/bloc/water_leak_bloc/water_leak_bloc.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:firebase_database/firebase_database.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/devices/bloc/water_leak_bloc/water_leak_event.dart'; import 'package:syncrow_app/features/devices/bloc/water_leak_bloc/water_leak_state.dart'; @@ -142,7 +143,7 @@ class WaterLeakBloc extends Bloc { // Handle error emit(WaterLeakFailedState(errorMessage: errorMessage)); - print('Error fetching logs: ${errorMessage}'); + debugPrint('Error fetching logs: ${errorMessage}'); } } diff --git a/lib/features/devices/view/widgets/water_leak/water_leak_records_screen.dart b/lib/features/devices/view/widgets/water_leak/water_leak_records_screen.dart index ee72efb..363a125 100644 --- a/lib/features/devices/view/widgets/water_leak/water_leak_records_screen.dart +++ b/lib/features/devices/view/widgets/water_leak/water_leak_records_screen.dart @@ -22,8 +22,7 @@ class WaterLeakRecordsScreen extends StatefulWidget { } class _WaterLeakRecordsScreenState extends State { - int _selectedIndex = 0; // Track the selected tab index - + int _selectedIndex = 0; @override Widget build(BuildContext context) { return DefaultScaffold( @@ -71,7 +70,7 @@ class _WaterLeakRecordsScreenState extends State { child: TabBar( onTap: (value) { setState(() { - _selectedIndex = value; // Update selected index + _selectedIndex = value; }); }, indicatorColor: Colors.white, diff --git a/lib/features/devices/view/widgets/water_leak/water_leak_screen.dart b/lib/features/devices/view/widgets/water_leak/water_leak_screen.dart index ee3834a..847f465 100644 --- a/lib/features/devices/view/widgets/water_leak/water_leak_screen.dart +++ b/lib/features/devices/view/widgets/water_leak/water_leak_screen.dart @@ -36,7 +36,6 @@ class WaterLeakScreen extends StatelessWidget { } else if (state is UpdateState) { model = state.waterSensor; } - print(model.batteryPercentage); return state is WaterLeakLoadingState ? const Center( child: DefaultContainer( @@ -70,7 +69,6 @@ class WaterLeakScreen extends StatelessWidget { children: [ Container( decoration: BoxDecoration( - // color: Colors.white.withOpacity(0.1), borderRadius: BorderRadius.circular(890), boxShadow: [ @@ -179,7 +177,6 @@ class WaterLeakScreen extends StatelessWidget { child: FittedBox( child: BodySmall( text: 'Notification Settings', - // doorLockButtons.keys.elementAt(index), textAlign: TextAlign.center, ), ), diff --git a/lib/services/api/devices_api.dart b/lib/services/api/devices_api.dart index 94573e4..e4a6188 100644 --- a/lib/services/api/devices_api.dart +++ b/lib/services/api/devices_api.dart @@ -33,7 +33,6 @@ class DevicesAPI { static Future> controlDevice( DeviceControlModel controlModel, String deviceId) async { try { - print(controlModel.toJson()); final response = await _httpService.post( path: ApiEndpoints.controlDevice.replaceAll('{deviceUuid}', deviceId), body: controlModel.toJson(), @@ -77,7 +76,7 @@ class DevicesAPI { .replaceAll('{deviceUuid}', deviceId), showServerMessage: false, expectedResponseModel: (json) { - print(json); + print('json======${json}'); return json; }, ); @@ -386,13 +385,11 @@ class DevicesAPI { String? code, bool? value, }) async { - print({"devicesUuid": devicesUuid, "code": code, "value": value}); final response = await _httpService.post( path: ApiEndpoints.controlBatch, body: {"devicesUuid": devicesUuid, "code": code, "value": value}, showServerMessage: true, expectedResponseModel: (json) { - print('json===$json'); return json; }, );