mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-24 22:57:56 +00:00
push bug fixes
This commit is contained in:
@@ -46,7 +46,7 @@ class AcDeviceBatchControlView extends StatelessWidget
|
||||
),
|
||||
children: [
|
||||
ToggleWidget(
|
||||
icon: Assets.ac,
|
||||
icon: Assets.acLock,
|
||||
deviceId: devicesIds.first,
|
||||
code: 'switch',
|
||||
value: state.status.acSwitch,
|
||||
@@ -80,8 +80,7 @@ class AcDeviceBatchControlView extends StatelessWidget
|
||||
code: 'child_lock',
|
||||
value: state.status.childLock,
|
||||
label: 'Child Lock',
|
||||
icon:
|
||||
state.status.childLock ? Assets.childLock : Assets.unlock,
|
||||
icon: state.status.childLock ? Assets.unlock : Assets.acLock,
|
||||
onChange: (value) {
|
||||
context.read<AcBloc>().add(AcBatchControlEvent(
|
||||
devicesIds: devicesIds,
|
||||
|
||||
@@ -46,6 +46,7 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
|
||||
value: state.status.acSwitch,
|
||||
code: 'switch',
|
||||
deviceId: device.uuid!,
|
||||
icon: Assets.ac,
|
||||
),
|
||||
CurrentTemp(
|
||||
currentTemp: state.status.currentTemp,
|
||||
@@ -68,8 +69,7 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
|
||||
code: 'child_lock',
|
||||
deviceId: device.uuid!,
|
||||
description: 'Child Lock',
|
||||
icon:
|
||||
state.status.childLock ? Assets.childLock : Assets.unlock,
|
||||
icon: state.status.childLock ? Assets.unlock : Assets.acLock,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -39,16 +39,21 @@ class AcToggle extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Container(
|
||||
color: ColorsManager.whiteColors,
|
||||
child: SvgPicture.asset(
|
||||
icon ?? Assets.lightPulp,
|
||||
width: 60,
|
||||
height: 60,
|
||||
fit: BoxFit.cover,
|
||||
Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: ColorsManager.whiteColors,
|
||||
),
|
||||
)),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: ClipOval(
|
||||
child: SvgPicture.asset(
|
||||
icon ?? Assets.lightPulp,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
width: 35,
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:syncrow_web/pages/device_managment/all_devices/helper/route_cont
|
||||
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/format_date_time.dart';
|
||||
|
||||
class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
|
||||
final AllDevicesModel device;
|
||||
@@ -91,8 +92,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
|
||||
],
|
||||
),
|
||||
TableRow(children: [
|
||||
_buildInfoRow('Virtual Address:',
|
||||
'Area - Street 1 - Building 1 - First Floor'),
|
||||
_buildInfoRow('Virtual Address:', '${device.ip}'),
|
||||
const SizedBox.shrink(),
|
||||
]),
|
||||
TableRow(
|
||||
@@ -103,7 +103,14 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
|
||||
),
|
||||
TableRow(
|
||||
children: [
|
||||
_buildInfoRow('Installation Date and Time:', '09/08/2024 13:30'),
|
||||
_buildInfoRow(
|
||||
'Installation Date and Time:',
|
||||
formatDateTime(
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
((device.createTime ?? 0) * 1000),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox.shrink(),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -11,7 +11,14 @@ class ScheduleDialogHelper {
|
||||
{ScheduleModel? schedule, int? index, bool? isEdit}) {
|
||||
final bloc = context.read<WaterHeaterBloc>();
|
||||
|
||||
if (schedule != null) {
|
||||
if (schedule == null) {
|
||||
bloc.add(InitializeAddScheduleEvent(
|
||||
selectedTime: null,
|
||||
selectedDays: List.filled(7, false),
|
||||
functionOn: false,
|
||||
isEditing: false,
|
||||
));
|
||||
} else {
|
||||
final time = _convertStringToTimeOfDay(schedule.time);
|
||||
final selectedDays = _convertDaysStringToBooleans(schedule.days);
|
||||
|
||||
@@ -22,16 +29,6 @@ class ScheduleDialogHelper {
|
||||
isEditing: true,
|
||||
index: index,
|
||||
));
|
||||
} else {
|
||||
bloc.add(
|
||||
const InitializeAddScheduleEvent(
|
||||
selectedDays: [false, false, false, false, false, false, false],
|
||||
functionOn: false,
|
||||
isEditing: false,
|
||||
index: null,
|
||||
selectedTime: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
showDialog(
|
||||
@@ -98,7 +95,7 @@ class ScheduleDialogHelper {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
state.selectedTime == null
|
||||
state.selectedTime == null || schedule == null
|
||||
? 'Time'
|
||||
: state.selectedTime!.format(context),
|
||||
style: context.textTheme.bodySmall!.copyWith(
|
||||
|
||||
@@ -24,6 +24,7 @@ class _BuildScheduleViewState extends State<BuildScheduleView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bloc = BlocProvider.of<WaterHeaterBloc>(context);
|
||||
|
||||
return BlocProvider.value(
|
||||
value: bloc,
|
||||
child: Dialog(
|
||||
|
||||
@@ -166,4 +166,7 @@ class Assets {
|
||||
|
||||
//assets/icons/water_heater.svg
|
||||
static const String waterHeater = 'assets/icons/water_heater.svg';
|
||||
|
||||
//assets/icons/ac_lock.svg
|
||||
static const String acLock = 'assets/icons/ac_lock.svg';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user