mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
remove socket from water heater
This commit is contained in:
@ -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<OneTouchEvent, OneTouchState> {
|
||||
oneTouchId,
|
||||
);
|
||||
} else {
|
||||
print('Invalid statusSelected or optionSelected');
|
||||
debugPrint('Invalid statusSelected or optionSelected');
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
final errorData = e.response!.data;
|
||||
|
@ -74,7 +74,7 @@ class WaterHeaterBloc extends Bloc<WaterHeaterEvent, WaterHeaterState> {
|
||||
statusModelList,
|
||||
);
|
||||
emit(UpdateState(whModel: deviceStatus));
|
||||
_listenToChanges();
|
||||
// _listenToChanges();
|
||||
} catch (e) {
|
||||
emit(WHFailedState(errorMessage: e.toString()));
|
||||
return;
|
||||
|
@ -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<WaterLeakEvent, WaterLeakState> {
|
||||
// Handle error
|
||||
emit(WaterLeakFailedState(errorMessage: errorMessage));
|
||||
|
||||
print('Error fetching logs: ${errorMessage}');
|
||||
debugPrint('Error fetching logs: ${errorMessage}');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,7 @@ class WaterLeakRecordsScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
|
||||
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<WaterLeakRecordsScreen> {
|
||||
child: TabBar(
|
||||
onTap: (value) {
|
||||
setState(() {
|
||||
_selectedIndex = value; // Update selected index
|
||||
_selectedIndex = value;
|
||||
});
|
||||
},
|
||||
indicatorColor: Colors.white,
|
||||
|
@ -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,
|
||||
),
|
||||
),
|
||||
|
@ -33,7 +33,6 @@ class DevicesAPI {
|
||||
static Future<Map<String, dynamic>> 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;
|
||||
},
|
||||
);
|
||||
|
Reference in New Issue
Block a user