mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Dev (#319)
<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [x] ✨ New feature (non-breaking change which adds functionality) - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 Code refactor - [ ] ✅ Build configuration change - [ ] 📝 Documentation - [ ] 🗑️ Chore
This commit is contained in:
4
assets/images/completed_done.svg
Normal file
4
assets/images/completed_done.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M37.8033 16.3567C37.2313 15.7848 36.3039 15.7847 35.7318 16.3568L21.5532 30.5353L14.2681 23.2504C13.6962 22.6784 12.7686 22.6783 12.1966 23.2505C11.6246 23.8226 11.6246 24.75 12.1966 25.3221L20.5174 33.6427C20.8034 33.9287 21.1783 34.0717 21.5531 34.0717C21.928 34.0717 22.3029 33.9287 22.5888 33.6426L37.8033 18.4283C38.3754 17.8563 38.3754 16.9288 37.8033 16.3567Z" fill="#023DFE" fill-opacity="0.7"/>
|
||||
<path d="M42.6776 7.32236C37.9558 2.60049 31.6776 0 25 0C18.3223 0 12.0442 2.60049 7.32236 7.32236C2.60039 12.0443 0 18.3224 0 25C0 31.6778 2.60039 37.9559 7.32236 42.6777C12.0441 47.3996 18.3223 50 25 50C31.6777 50 37.9558 47.3996 42.6776 42.6777C47.3995 37.9559 50 31.6778 50 25C50 18.3224 47.3995 12.0443 42.6776 7.32236ZM25 47.0703C12.8304 47.0703 2.92969 37.1696 2.92969 25C2.92969 12.8304 12.8304 2.92969 25 2.92969C37.1696 2.92969 47.0703 12.8304 47.0703 25C47.0703 37.1696 37.1696 47.0703 25 47.0703Z" fill="#023DFE" fill-opacity="0.7"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
@ -39,8 +39,12 @@ class AnalyticsDevice {
|
||||
? ProductDevice.fromJson(json['productDevice'] as Map<String, dynamic>)
|
||||
: null,
|
||||
spaceUuid: json['spaceUuid'] as String?,
|
||||
latitude: json['lat'] != null ? double.parse(json['lat'] as String? ?? '0.0') : null,
|
||||
longitude: json['lon'] != null ? double.parse(json['lon'] as String? ?? '0.0') : null,
|
||||
latitude: json['lat'] != null && json['lat'] != ''
|
||||
? double.tryParse(json['lat']?.toString() ?? '0.0')
|
||||
: null,
|
||||
longitude: json['lon'] != null && json['lon'] != ''
|
||||
? double.tryParse(json['lon']?.toString() ?? '0.0')
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,16 @@ class Status {
|
||||
};
|
||||
}
|
||||
|
||||
Status copyWith({
|
||||
String? code,
|
||||
dynamic value,
|
||||
}) {
|
||||
return Status(
|
||||
code: code ?? this.code,
|
||||
value: value ?? this.value,
|
||||
);
|
||||
}
|
||||
|
||||
factory Status.fromJson(String source) => Status.fromMap(json.decode(source));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
@ -4,6 +4,7 @@ import 'package:syncrow_web/pages/device_managment/curtain_module/bloc/curtain_m
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/accurate_dialog_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/calibrate_completed_dialog.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/normal_text_body_for_dialog.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
class AccurteCalibratingDialog extends StatelessWidget {
|
||||
final String deviceId;
|
||||
@ -17,6 +18,7 @@ class AccurteCalibratingDialog extends StatelessWidget {
|
||||
@override
|
||||
Widget build(_) {
|
||||
return AlertDialog(
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: AccurateDialogWidget(
|
||||
title: 'Calibrating',
|
||||
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/accurate_calibrating_dialog.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/accurate_dialog_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/normal_text_body_for_dialog.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
class AccurateCalibrationDialog extends StatelessWidget {
|
||||
final String deviceId;
|
||||
@ -15,6 +16,7 @@ class AccurateCalibrationDialog extends StatelessWidget {
|
||||
@override
|
||||
Widget build(_) {
|
||||
return AlertDialog(
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: AccurateDialogWidget(
|
||||
title: 'Accurate Calibration',
|
||||
|
@ -22,6 +22,7 @@ class AccurateDialogWidget extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
@ -43,17 +44,22 @@ class AccurateDialogWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: body,
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
const Divider(),
|
||||
const Expanded(child: Divider()),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(26),
|
||||
),
|
||||
onTap: leftOnTap,
|
||||
child: Container(
|
||||
height: 40,
|
||||
@ -64,6 +70,9 @@ class AccurateDialogWidget extends StatelessWidget {
|
||||
color: ColorsManager.grayBorder,
|
||||
),
|
||||
),
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(26),
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
'Cancel',
|
||||
@ -74,6 +83,9 @@ class AccurateDialogWidget extends StatelessWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomRight: Radius.circular(26),
|
||||
),
|
||||
onTap: rightOnTap,
|
||||
child: Container(
|
||||
height: 40,
|
||||
@ -84,6 +96,9 @@ class AccurateDialogWidget extends StatelessWidget {
|
||||
color: ColorsManager.grayBorder,
|
||||
),
|
||||
),
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(26),
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
'Next',
|
||||
|
@ -28,7 +28,7 @@ class NormalTextBodyForDialog extends StatelessWidget {
|
||||
title,
|
||||
style: const TextStyle(
|
||||
color: ColorsManager.grayColor,
|
||||
fontSize: 17,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -42,7 +42,7 @@ class NormalTextBodyForDialog extends StatelessWidget {
|
||||
const Text('1. ',
|
||||
style: TextStyle(
|
||||
color: ColorsManager.grayColor,
|
||||
fontSize: 17,
|
||||
fontSize: 15,
|
||||
)),
|
||||
SizedBox(
|
||||
width: 450,
|
||||
@ -50,7 +50,7 @@ class NormalTextBodyForDialog extends StatelessWidget {
|
||||
step1,
|
||||
style: const TextStyle(
|
||||
color: ColorsManager.grayColor,
|
||||
fontSize: 17,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -67,13 +67,13 @@ class NormalTextBodyForDialog extends StatelessWidget {
|
||||
const Text('2. ',
|
||||
style: TextStyle(
|
||||
color: ColorsManager.grayColor,
|
||||
fontSize: 17,
|
||||
fontSize: 15,
|
||||
)),
|
||||
Text(
|
||||
step2,
|
||||
style: const TextStyle(
|
||||
color: ColorsManager.grayColor,
|
||||
fontSize: 17,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -63,6 +63,7 @@ class _QuickCalibratingDialogState extends State<QuickCalibratingDialog> {
|
||||
@override
|
||||
Widget build(_) {
|
||||
return AlertDialog(
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: AccurateDialogWidget(
|
||||
title: 'Calibrating',
|
||||
@ -71,7 +72,7 @@ class _QuickCalibratingDialogState extends State<QuickCalibratingDialog> {
|
||||
children: [
|
||||
const Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
alignment: Alignment.topCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 75),
|
||||
child: Text(
|
||||
@ -85,17 +86,21 @@ class _QuickCalibratingDialogState extends State<QuickCalibratingDialog> {
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Container(
|
||||
width: 110,
|
||||
width: 130,
|
||||
padding: const EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.neutralGray.withValues(
|
||||
alpha: 0.5,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: NumberInputField(controller: _controller),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsGeometry.only(left: 5),
|
||||
child: NumberInputField(controller: _controller)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
@ -127,7 +132,7 @@ class _QuickCalibratingDialogState extends State<QuickCalibratingDialog> {
|
||||
),
|
||||
const Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Text(
|
||||
'2.click Next to Complete the calibration',
|
||||
style: TextStyle(color: ColorsManager.lightGrayColor),
|
||||
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/accurate_dialog_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/normal_text_body_for_dialog.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/quick_calibrating_dialog.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
class QuickCalibrationDialog extends StatelessWidget {
|
||||
final int timControl;
|
||||
@ -17,6 +18,7 @@ class QuickCalibrationDialog extends StatelessWidget {
|
||||
@override
|
||||
Widget build(_) {
|
||||
return AlertDialog(
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: AccurateDialogWidget(
|
||||
title: 'Quick Calibration',
|
||||
|
@ -286,11 +286,20 @@ class ScheduleBloc extends Bloc<ScheduleEvent, ScheduleState> {
|
||||
try {
|
||||
if (state is ScheduleLoaded) {
|
||||
final dateTime = DateTime.parse(event.time);
|
||||
Status status = Status(code: '', value: '');
|
||||
if (event.category == 'CUR_2') {
|
||||
status = status.copyWith(
|
||||
code: 'control',
|
||||
value: event.functionOn == true ? 'open' : 'close');
|
||||
} else {
|
||||
status =
|
||||
status.copyWith(code: event.category, value: event.functionOn);
|
||||
}
|
||||
final updatedSchedule = ScheduleEntry(
|
||||
scheduleId: event.scheduleId,
|
||||
category: event.category,
|
||||
time: getTimeStampWithoutSeconds(dateTime).toString(),
|
||||
function: Status(code: event.category, value: event.functionOn),
|
||||
function: status,
|
||||
days: event.selectedDays,
|
||||
);
|
||||
final success = await DevicesManagementApi().editScheduleRecord(
|
||||
|
@ -52,9 +52,12 @@ class BuildScheduleView extends StatelessWidget {
|
||||
children: [
|
||||
const ScheduleHeader(),
|
||||
const SizedBox(height: 20),
|
||||
ScheduleModeSelector(
|
||||
currentMode: state.scheduleMode,
|
||||
),
|
||||
if (category == 'CUR_2')
|
||||
const SizedBox()
|
||||
else
|
||||
ScheduleModeSelector(
|
||||
currentMode: state.scheduleMode,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
if (state.scheduleMode == ScheduleModes.schedule)
|
||||
ScheduleManagementUI(
|
||||
|
@ -212,12 +212,20 @@ class _ScheduleTableView extends StatelessWidget {
|
||||
isEdit: true,
|
||||
).then((updatedSchedule) {
|
||||
if (updatedSchedule != null) {
|
||||
bool temp;
|
||||
if (schedule.category == 'CUR_2') {
|
||||
updatedSchedule.function.value == 'open'
|
||||
? temp = true
|
||||
: temp = false;
|
||||
} else {
|
||||
temp = updatedSchedule.function.value;
|
||||
}
|
||||
context.read<ScheduleBloc>().add(
|
||||
ScheduleEditEvent(
|
||||
scheduleId: schedule.scheduleId,
|
||||
category: schedule.category,
|
||||
time: updatedSchedule.time,
|
||||
functionOn: updatedSchedule.function.value,
|
||||
functionOn: temp,
|
||||
selectedDays: updatedSchedule.days),
|
||||
);
|
||||
}
|
||||
|
@ -58,11 +58,14 @@ class ProductModel {
|
||||
'3G': Assets.Gang3SwitchIcon,
|
||||
'3GT': Assets.threeTouchSwitch,
|
||||
'CUR': Assets.curtain,
|
||||
'CUR_2': Assets.curtain,
|
||||
'GD': Assets.garageDoor,
|
||||
'GW': Assets.SmartGatewayIcon,
|
||||
'DL': Assets.DoorLockIcon,
|
||||
'WL': Assets.waterLeakSensor,
|
||||
'WH': Assets.waterHeater,
|
||||
'WM': Assets.waterLeakSensor,
|
||||
'SOS': Assets.sos,
|
||||
'AC': Assets.ac,
|
||||
'CPS': Assets.presenceSensor,
|
||||
'PC': Assets.powerClamp,
|
||||
|
Reference in New Issue
Block a user