mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-27 08:04:14 +00:00
Implemented Acs functions and fixed design issue
This commit is contained in:
@@ -10,12 +10,13 @@ import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
class ACsBloc extends Bloc<AcsEvent, AcsState> {
|
||||
final String acId;
|
||||
late DeviceModel deviceModel;
|
||||
late AcStatusModel deviceStatus;
|
||||
|
||||
ACsBloc({required this.acId}) : super(AcsInitialState()) {
|
||||
on<AcsInitial>(_fetchAcsStatus);
|
||||
on<IncreaseCoolToTemp>(_increaseCoolTo);
|
||||
on<DecreaseCoolToTemp>(_decreaseCoolTo);
|
||||
on<SetCurrentTemp>(_setCurrentTemperature);
|
||||
on<ChangeLock>(_changeLockValue);
|
||||
on<ChangeAcMode>(_changeAcMode);
|
||||
on<ChangeFanSpeed>(_changeFanSpeed);
|
||||
}
|
||||
@@ -28,7 +29,7 @@ class ACsBloc extends Bloc<AcsEvent, AcsState> {
|
||||
for (var status in response['status']) {
|
||||
statusModelList.add(StatusModel.fromJson(status));
|
||||
}
|
||||
AcStatusModel deviceStatus = AcStatusModel.fromJson(statusModelList);
|
||||
deviceStatus = AcStatusModel.fromJson(statusModelList);
|
||||
emit(GetAcStatusState(acStatusModel: deviceStatus));
|
||||
} catch (e) {
|
||||
emit(AcsFailedState(error: e.toString()));
|
||||
@@ -36,82 +37,82 @@ class ACsBloc extends Bloc<AcsEvent, AcsState> {
|
||||
}
|
||||
}
|
||||
|
||||
void _setCurrentTemperature(SetCurrentTemp event, Emitter<AcsState> emit) async {
|
||||
emit(AcChangeTempLoading());
|
||||
int value = (event.value * 10).toInt();
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'temp_current', value: value), acId);
|
||||
void _changeLockValue(ChangeLock event, Emitter<AcsState> emit) async {
|
||||
emit(AcChangeLoading(acStatusModel: deviceStatus));
|
||||
|
||||
if (response['success'] ?? false) {
|
||||
// emit(AcIncreaseCoolTo(tempValue: tempValue));
|
||||
} else {
|
||||
emit(const AcsFailedState(error: 'Cannot change the device temperature'));
|
||||
// emit(AcIncreaseCoolTo(tempValue: event.value));
|
||||
}
|
||||
final lockValue = !event.lockBool;
|
||||
try {
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'child_lock', value: lockValue), acId);
|
||||
|
||||
if (response['success'] ?? false) {
|
||||
deviceStatus.childLock = lockValue;
|
||||
}
|
||||
} catch (_) {}
|
||||
emit(AcModifyingState(acStatusModel: deviceStatus));
|
||||
}
|
||||
|
||||
void _increaseCoolTo(IncreaseCoolToTemp event, Emitter<AcsState> emit) async {
|
||||
emit(AcChangeTempLoading());
|
||||
|
||||
emit(AcChangeLoading(acStatusModel: deviceStatus));
|
||||
double tempValue = event.value + 0.5;
|
||||
int value = (tempValue * 10).toInt();
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'temp_set', value: value), acId);
|
||||
try {
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'temp_set', value: value), acId);
|
||||
|
||||
if (response['success'] ?? false) {
|
||||
emit(AcIncreaseCoolTo(tempValue: tempValue));
|
||||
} else {
|
||||
emit(const AcsFailedState(error: 'Cannot change the device temperature'));
|
||||
emit(AcIncreaseCoolTo(tempValue: event.value));
|
||||
}
|
||||
if (response['success'] ?? false) {
|
||||
deviceStatus.tempSet = value;
|
||||
}
|
||||
} catch (_) {}
|
||||
emit(AcModifyingState(acStatusModel: deviceStatus));
|
||||
}
|
||||
|
||||
void _decreaseCoolTo(DecreaseCoolToTemp event, Emitter<AcsState> emit) async {
|
||||
emit(AcChangeTempLoading());
|
||||
emit(AcChangeLoading(acStatusModel: deviceStatus));
|
||||
|
||||
double tempValue = event.value - 0.5;
|
||||
int value = (tempValue * 10).toInt();
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'temp_set', value: value), acId);
|
||||
try {
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'temp_set', value: value), acId);
|
||||
|
||||
if (response['success'] ?? false) {
|
||||
emit(AcDecreaseCoolTo(tempValue: tempValue));
|
||||
} else {
|
||||
emit(const AcsFailedState(error: 'Cannot change the device temperature'));
|
||||
emit(AcDecreaseCoolTo(tempValue: event.value));
|
||||
}
|
||||
if (response['success'] ?? false) {
|
||||
deviceStatus.tempSet = value;
|
||||
}
|
||||
} catch (_) {}
|
||||
emit(AcModifyingState(acStatusModel: deviceStatus));
|
||||
}
|
||||
|
||||
void _changeAcMode(ChangeAcMode event, Emitter<AcsState> emit) async {
|
||||
emit(AcChangeTempLoading());
|
||||
|
||||
emit(AcChangeLoading(acStatusModel: deviceStatus));
|
||||
final tempMode = tempModesMap[getNextItem(tempModesMap, event.tempModes)]!;
|
||||
try {
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'mode', value: getACModeString(tempMode)), acId);
|
||||
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'mode', value: getACModeString(tempMode)), acId);
|
||||
|
||||
if (response['success'] ?? false) {
|
||||
emit(AcModeState(tempModes: tempMode));
|
||||
} else {
|
||||
emit(const AcsFailedState(error: 'Cannot change the device temperature'));
|
||||
// emit(AcDecreaseCoolTo(tempValue: event.value));
|
||||
}
|
||||
if (response['success'] ?? false) {
|
||||
deviceStatus.modeString = getACModeString(tempMode);
|
||||
deviceStatus.acMode = AcStatusModel.getACMode(getACModeString(tempMode));
|
||||
}
|
||||
} catch (_) {}
|
||||
emit(AcModifyingState(acStatusModel: deviceStatus));
|
||||
}
|
||||
|
||||
void _changeFanSpeed(ChangeFanSpeed event, Emitter<AcsState> emit) async {
|
||||
emit(AcChangeTempLoading());
|
||||
emit(AcChangeLoading(acStatusModel: deviceStatus));
|
||||
|
||||
final fanSpeed = event.fanSpeeds;
|
||||
final response = await DevicesAPI.controlDevice(
|
||||
DeviceControlModel(deviceId: acId, code: 'level', value: getNextFanSpeedKey(fanSpeed)),
|
||||
acId);
|
||||
|
||||
if (response['success'] ?? false) {
|
||||
emit(FanSpeedState(fanSpeeds: fanSpeed));
|
||||
} else {
|
||||
emit(const AcsFailedState(error: 'Cannot change the device temperature'));
|
||||
// emit(AcDecreaseCoolTo(tempValue: event.value));
|
||||
}
|
||||
try {
|
||||
if (response['success'] ?? false) {
|
||||
deviceStatus.fanSpeedsString = getNextFanSpeedKey(fanSpeed);
|
||||
deviceStatus.acFanSpeed = AcStatusModel.getFanSpeed(getNextFanSpeedKey(fanSpeed));
|
||||
}
|
||||
} catch (_) {}
|
||||
emit(AcModifyingState(acStatusModel: deviceStatus));
|
||||
}
|
||||
|
||||
String getACModeString(TempModes value) {
|
||||
|
||||
@@ -30,14 +30,6 @@ class DecreaseCoolToTemp extends AcsEvent {
|
||||
List<Object> get props => [value];
|
||||
}
|
||||
|
||||
class SetCurrentTemp extends AcsEvent {
|
||||
final double value;
|
||||
const SetCurrentTemp({required this.value});
|
||||
|
||||
@override
|
||||
List<Object> get props => [value];
|
||||
}
|
||||
|
||||
class ChangeAcMode extends AcsEvent {
|
||||
final TempModes tempModes;
|
||||
const ChangeAcMode({required this.tempModes});
|
||||
@@ -53,3 +45,11 @@ class ChangeFanSpeed extends AcsEvent {
|
||||
@override
|
||||
List<Object> get props => [fanSpeeds];
|
||||
}
|
||||
|
||||
class ChangeLock extends AcsEvent {
|
||||
final bool lockBool;
|
||||
const ChangeLock({required this.lockBool});
|
||||
|
||||
@override
|
||||
List<Object> get props => [lockBool];
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:syncrow_app/features/devices/model/status_model.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
|
||||
abstract class AcsState extends Equatable {
|
||||
const AcsState();
|
||||
@@ -13,30 +12,20 @@ class AcsInitialState extends AcsState {}
|
||||
|
||||
class AcsLoadingState extends AcsState {}
|
||||
|
||||
class AcChangeTempLoading extends AcsState {}
|
||||
|
||||
class AcChangeCurrentTempState extends AcsState {
|
||||
final double currentValue;
|
||||
const AcChangeCurrentTempState({required this.currentValue});
|
||||
class AcChangeLoading extends AcsState {
|
||||
final AcStatusModel acStatusModel;
|
||||
const AcChangeLoading({required this.acStatusModel});
|
||||
|
||||
@override
|
||||
List<Object> get props => [currentValue];
|
||||
List<Object> get props => [acStatusModel];
|
||||
}
|
||||
|
||||
class AcIncreaseCoolTo extends AcsState {
|
||||
final double tempValue;
|
||||
const AcIncreaseCoolTo({required this.tempValue});
|
||||
class AcModifyingState extends AcsState {
|
||||
final AcStatusModel acStatusModel;
|
||||
const AcModifyingState({required this.acStatusModel});
|
||||
|
||||
@override
|
||||
List<Object> get props => [tempValue];
|
||||
}
|
||||
|
||||
class AcDecreaseCoolTo extends AcsState {
|
||||
final double tempValue;
|
||||
const AcDecreaseCoolTo({required this.tempValue});
|
||||
|
||||
@override
|
||||
List<Object> get props => [tempValue];
|
||||
List<Object> get props => [acStatusModel];
|
||||
}
|
||||
|
||||
class GetAcStatusState extends AcsState {
|
||||
@@ -47,24 +36,9 @@ class GetAcStatusState extends AcsState {
|
||||
List<Object> get props => [acStatusModel];
|
||||
}
|
||||
|
||||
class AcModeState extends AcsState {
|
||||
final TempModes tempModes;
|
||||
const AcModeState({required this.tempModes});
|
||||
|
||||
@override
|
||||
List<Object> get props => [tempModes];
|
||||
}
|
||||
|
||||
class FanSpeedState extends AcsState {
|
||||
final FanSpeeds fanSpeeds;
|
||||
const FanSpeedState({required this.fanSpeeds});
|
||||
|
||||
@override
|
||||
List<Object> get props => [fanSpeeds];
|
||||
}
|
||||
|
||||
class AcsFailedState extends AcsState {
|
||||
final String error;
|
||||
|
||||
const AcsFailedState({required this.error});
|
||||
|
||||
@override
|
||||
|
||||
@@ -52,7 +52,7 @@ class AcStatusModel {
|
||||
childLock: _childLock);
|
||||
}
|
||||
|
||||
TempModes getACMode(String value) {
|
||||
static TempModes getACMode(String value) {
|
||||
if (value == 'cold') {
|
||||
return TempModes.cold;
|
||||
} else if (value == 'hot') {
|
||||
@@ -64,7 +64,7 @@ class AcStatusModel {
|
||||
}
|
||||
}
|
||||
|
||||
FanSpeeds getFanSpeed(String value) {
|
||||
static FanSpeeds getFanSpeed(String value) {
|
||||
if (value == 'low') {
|
||||
return FanSpeeds.low;
|
||||
} else if (value == 'middle') {
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_state.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/ACs/ac_interface_controls.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/ACs/ac_interface_temp_unit.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/font_manager.dart';
|
||||
|
||||
class AcInterface extends StatelessWidget {
|
||||
const AcInterface({super.key, required this.ac});
|
||||
@@ -49,37 +44,30 @@ class AcInterface extends StatelessWidget {
|
||||
opacity: 0.4,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: Constants.appBarHeight,
|
||||
left: Constants.defaultPadding,
|
||||
right: Constants.defaultPadding,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 380,
|
||||
),
|
||||
child: AcInterfaceTempUnit(
|
||||
acDevice: ac,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 380,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
child: AcInterfaceTempUnit(
|
||||
acDevice: ac,
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 130,
|
||||
),
|
||||
child: AcInterfaceControls(
|
||||
deviceModel: ac,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 130,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: AcInterfaceControls(
|
||||
deviceModel: ac,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_events.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_state.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/ACs/ac_mode_control_unit.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
@@ -21,6 +21,25 @@ class AcInterfaceControls extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<ACsBloc, AcsState>(
|
||||
builder: (context, state) {
|
||||
String lockIconName = Assets.assetsIconsLock;
|
||||
bool lockValue = false;
|
||||
|
||||
if (state is GetAcStatusState) {
|
||||
lockIconName =
|
||||
state.acStatusModel.childLock ? Assets.assetsIconsLock : Assets.assetsIconsUnLock;
|
||||
lockValue = state.acStatusModel.childLock;
|
||||
}
|
||||
if (state is AcChangeLoading) {
|
||||
lockIconName =
|
||||
state.acStatusModel.childLock ? Assets.assetsIconsLock : Assets.assetsIconsUnLock;
|
||||
lockValue = state.acStatusModel.childLock;
|
||||
}
|
||||
if (state is AcModifyingState) {
|
||||
lockIconName =
|
||||
state.acStatusModel.childLock ? Assets.assetsIconsLock : Assets.assetsIconsUnLock;
|
||||
lockValue = state.acStatusModel.childLock;
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
ACModeControlUnit(acDevice: deviceModel),
|
||||
@@ -28,7 +47,7 @@ class AcInterfaceControls extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
child: DefaultContainer(
|
||||
height: 55,
|
||||
@@ -40,12 +59,14 @@ class AcInterfaceControls extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
BlocProvider.of<ACsBloc>(context).add(ChangeLock(lockBool: lockValue));
|
||||
},
|
||||
child: DefaultContainer(
|
||||
height: 55,
|
||||
child: Center(
|
||||
child: SvgPicture.asset(Assets.assetsIconsLock),
|
||||
child: SvgPicture.asset(lockIconName),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:sleek_circular_slider/sleek_circular_slider.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_events.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_state.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
@@ -27,7 +26,6 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<ACsBloc, AcsState>(
|
||||
builder: (context, state) {
|
||||
// double setToTemp = 250;
|
||||
return DefaultContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -54,8 +52,14 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
||||
fontWeight: FontsManager.regular,
|
||||
),
|
||||
modifier: (double value) {
|
||||
// return '${DeviceModel.temperature.toStringAsFixed(1)}°C';
|
||||
return '${value.toStringAsFixed(1)}°C';
|
||||
double temp = state is GetAcStatusState
|
||||
? state.acStatusModel.currentTemp / 10
|
||||
: state is AcModifyingState
|
||||
? state.acStatusModel.currentTemp / 10
|
||||
: state is AcChangeLoading
|
||||
? state.acStatusModel.currentTemp / 10
|
||||
: 25;
|
||||
return '$temp°C';
|
||||
},
|
||||
mainLabelStyle: context.titleLarge.copyWith(
|
||||
height: 0,
|
||||
@@ -72,24 +76,15 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
// min: DeviceModel.bounds.min,
|
||||
// max: DeviceModel.bounds.max,
|
||||
min: 20,
|
||||
max: 30,
|
||||
initialValue:
|
||||
state is GetAcStatusState ? state.acStatusModel.currentTemp / 10 : 25,
|
||||
onChange: (value) async {
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
// String valueAsString = value.toStringAsFixed(1);
|
||||
// if (valueAsString.endsWith(".0") || valueAsString.endsWith(".5")) {
|
||||
// value = double.parse(valueAsString);
|
||||
BlocProvider.of<ACsBloc>(context).add(SetCurrentTemp(value: value));
|
||||
// await DevicesCubit.getInstance().deviceControl(
|
||||
// DeviceControlModel(
|
||||
// deviceId: acDevice.uuid, code: 'temp_set', value: value * 10),
|
||||
// acDevice.uuid!);
|
||||
// }
|
||||
},
|
||||
initialValue: state is GetAcStatusState
|
||||
? state.acStatusModel.tempSet / 10
|
||||
: state is AcModifyingState
|
||||
? state.acStatusModel.tempSet / 10
|
||||
: state is AcChangeLoading
|
||||
? state.acStatusModel.tempSet / 10
|
||||
: 25,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -102,37 +97,21 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
||||
dimension: 24,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (state is AcChangeTempLoading) {
|
||||
if (state is AcChangeLoading) {
|
||||
return;
|
||||
}
|
||||
|
||||
double tempValue = 0;
|
||||
if (state is AcIncreaseCoolTo) {
|
||||
tempValue = state.tempValue;
|
||||
if (state is AcModifyingState) {
|
||||
tempValue = state.acStatusModel.tempSet / 10;
|
||||
} else if (state is GetAcStatusState) {
|
||||
tempValue = state.acStatusModel.tempSet / 10;
|
||||
} else if (state is AcDecreaseCoolTo) {
|
||||
tempValue = state.tempValue;
|
||||
}
|
||||
|
||||
if (tempValue > 20) {
|
||||
BlocProvider.of<ACsBloc>(context)
|
||||
.add(DecreaseCoolToTemp(value: tempValue));
|
||||
}
|
||||
//TODO refactor the loading check
|
||||
// if (state is AcsLoadingState ||
|
||||
// state is DeviceControlSuccess ||
|
||||
// state is DeviceControlLoading) {
|
||||
// return;
|
||||
// }
|
||||
// if (setToTemp > 20) {
|
||||
// DevicesCubit.getInstance().deviceControl(
|
||||
// DeviceControlModel(
|
||||
// deviceId: acDevice.uuid,
|
||||
// code: 'temp_set',
|
||||
// value: (setToTemp - 0.5) * 10),
|
||||
// acDevice.uuid!);
|
||||
// }
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
Assets.assetsIconsMinus,
|
||||
@@ -143,11 +122,11 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
||||
children: [
|
||||
BodyLarge(
|
||||
// text: "${DeviceModel.coolTo}° C",
|
||||
text: state is AcIncreaseCoolTo
|
||||
? '${state.tempValue}° C'
|
||||
: state is AcDecreaseCoolTo
|
||||
? '${state.tempValue}° C'
|
||||
: state is GetAcStatusState
|
||||
text: state is GetAcStatusState
|
||||
? '${state.acStatusModel.tempSet / 10}° C'
|
||||
: state is AcModifyingState
|
||||
? '${state.acStatusModel.tempSet / 10}° C'
|
||||
: state is AcChangeLoading
|
||||
? '${state.acStatusModel.tempSet / 10}° C'
|
||||
: '',
|
||||
style: context.bodyLarge.copyWith(
|
||||
@@ -168,36 +147,22 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
||||
dimension: 24,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (state is AcChangeTempLoading) {
|
||||
if (state is AcChangeLoading) {
|
||||
return;
|
||||
}
|
||||
|
||||
double tempValue = 0;
|
||||
if (state is AcIncreaseCoolTo) {
|
||||
tempValue = state.tempValue;
|
||||
if (state is AcModifyingState) {
|
||||
tempValue = state.acStatusModel.tempSet / 10;
|
||||
} else if (state is GetAcStatusState) {
|
||||
tempValue = state.acStatusModel.tempSet / 10;
|
||||
} else if (state is AcDecreaseCoolTo) {
|
||||
tempValue = state.tempValue;
|
||||
} else if (state is AcChangeLoading) {
|
||||
tempValue = state.acStatusModel.tempSet / 10;
|
||||
}
|
||||
|
||||
if (tempValue < 30) {
|
||||
BlocProvider.of<ACsBloc>(context)
|
||||
.add(IncreaseCoolToTemp(value: tempValue));
|
||||
}
|
||||
// if (state is GetDeviceStatusLoading ||
|
||||
// state is DeviceControlSuccess ||
|
||||
// state is DeviceControlLoading) {
|
||||
// return;
|
||||
// }
|
||||
// if (setToTemp < 30) {
|
||||
// DevicesCubit.getInstance().deviceControl(
|
||||
// DeviceControlModel(
|
||||
// deviceId: acDevice.uuid,
|
||||
// code: 'temp_set',
|
||||
// value: (setToTemp + 0.5) * 10),
|
||||
// acDevice.uuid!);
|
||||
// }
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
Assets.assetsIconsPlus,
|
||||
|
||||
@@ -4,8 +4,6 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_events.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_state.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
@@ -27,63 +25,52 @@ class ACModeControlUnit extends StatelessWidget {
|
||||
return Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// print(
|
||||
// '\n\ncurrentFanSpeed:$fanSpeed \nchanged to:\t${fanSpeedsMap[getNextFanSpeedKey(fanSpeed)]!}\nKey:\t\t\"${reversedFanSpeedsMap[fanSpeedsMap[getNextFanSpeedKey(fanSpeed)]!]!}\"');
|
||||
if (state is GetAcStatusState) {
|
||||
BlocProvider.of<ACsBloc>(context)
|
||||
.add(ChangeFanSpeed(fanSpeeds: state.acStatusModel.acFanSpeed));
|
||||
} else if (state is FanSpeedState) {
|
||||
} else if (state is AcModifyingState) {
|
||||
BlocProvider.of<ACsBloc>(context)
|
||||
.add(ChangeFanSpeed(fanSpeeds: state.fanSpeeds));
|
||||
.add(ChangeFanSpeed(fanSpeeds: state.acStatusModel.acFanSpeed));
|
||||
}
|
||||
|
||||
// DevicesCubit.getInstance().deviceControl(
|
||||
// DeviceControlModel(
|
||||
// deviceId: acDevice.uuid,
|
||||
// code: 'level',
|
||||
// value: reversedFanSpeedsMap[fanSpeed]!),
|
||||
// acDevice.uuid!);
|
||||
},
|
||||
child: DefaultContainer(
|
||||
height: 55,
|
||||
child: Center(
|
||||
child: state is GetAcStatusState
|
||||
? SvgPicture.asset(fanSpeedsIconMap[state.acStatusModel.acFanSpeed]!)
|
||||
: state is FanSpeedState
|
||||
? SvgPicture.asset(fanSpeedsIconMap[state.fanSpeeds]!)
|
||||
: const CircularProgressIndicator()),
|
||||
: state is AcModifyingState
|
||||
? SvgPicture.asset(fanSpeedsIconMap[state.acStatusModel.acFanSpeed]!)
|
||||
: state is AcChangeLoading
|
||||
? SvgPicture.asset(
|
||||
fanSpeedsIconMap[state.acStatusModel.acFanSpeed]!)
|
||||
: const CircularProgressIndicator()),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (state is GetAcStatusState) {
|
||||
BlocProvider.of<ACsBloc>(context)
|
||||
.add(ChangeAcMode(tempModes: state.acStatusModel.acMode));
|
||||
} else if (state is FanSpeedState) {
|
||||
} else if (state is AcModifyingState) {
|
||||
BlocProvider.of<ACsBloc>(context)
|
||||
.add(ChangeFanSpeed(fanSpeeds: state.fanSpeeds));
|
||||
.add(ChangeAcMode(tempModes: state.acStatusModel.acMode));
|
||||
}
|
||||
// tempMode = tempModesMap[getNextItem(tempModesMap, tempMode)]!;
|
||||
// DevicesCubit.getInstance().deviceControl(
|
||||
// DeviceControlModel(
|
||||
// deviceId: acDevice.uuid,
|
||||
// code: 'mode',
|
||||
// value: reversedTempModesMap[tempMode]!),
|
||||
// acDevice.uuid!);
|
||||
},
|
||||
child: DefaultContainer(
|
||||
height: 55,
|
||||
child: Center(
|
||||
child: state is GetAcStatusState
|
||||
? SvgPicture.asset(tempModesIconMap[state.acStatusModel.acMode]!)
|
||||
: state is AcModeState
|
||||
? SvgPicture.asset(tempModesIconMap[state.tempModes]!)
|
||||
: const CircularProgressIndicator(),
|
||||
: state is AcModifyingState
|
||||
? SvgPicture.asset(tempModesIconMap[state.acStatusModel.acMode]!)
|
||||
: state is AcChangeLoading
|
||||
? SvgPicture.asset(tempModesIconMap[state.acStatusModel.acMode]!)
|
||||
: const CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -3,13 +3,11 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_state.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
|
||||
class ACTempWidget extends StatelessWidget {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/acs_bloc/acs_events.dart';
|
||||
@@ -28,46 +27,40 @@ class ACsView extends StatelessWidget {
|
||||
// if (DevicesCubit.getInstance().getSelectedDevice() is DeviceModel) {
|
||||
// selectedAC = DevicesCubit.getInstance().getSelectedDevice() as DeviceModel;
|
||||
// }
|
||||
return AnnotatedRegion(
|
||||
value: SystemUiOverlayStyle(
|
||||
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
return Scaffold(
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
// extendBodyBehindAppBar: true,
|
||||
// extendBody: true,
|
||||
appBar: CategoryViewAppBar(
|
||||
title: deviceModel?.name ?? '',
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
appBar: CategoryViewAppBar(
|
||||
title: deviceModel?.name ?? '',
|
||||
body: SafeArea(
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
Assets.assetsImagesBackground,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
opacity: 0.4,
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
Assets.assetsImagesBackground,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
opacity: 0.4,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: Constants.appBarHeight,
|
||||
left: Constants.defaultPadding,
|
||||
right: Constants.defaultPadding,
|
||||
),
|
||||
child: state is AcsLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50, height: 50, child: CircularProgressIndicator()),
|
||||
)
|
||||
: SizedBox.expand(
|
||||
child: deviceModel != null ? AcInterface(ac: deviceModel!) : ACsList(),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: Constants.defaultPadding,
|
||||
left: Constants.defaultPadding,
|
||||
right: Constants.defaultPadding,
|
||||
),
|
||||
child: state is AcsLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50, height: 50, child: CircularProgressIndicator()),
|
||||
)
|
||||
: SizedBox.expand(
|
||||
child: deviceModel != null ? AcInterface(ac: deviceModel!) : ACsList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
/// This widget displays the icon and name of the device, along with a switch
|
||||
/// to control its state. Tapping on the widget opens the device interface.
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||
@@ -16,6 +17,7 @@ import 'package:syncrow_app/features/devices/view/widgets/three_gang/three_gang_
|
||||
import 'package:syncrow_app/features/shared_widgets/custom_switch.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/navigation/navigation_service.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
import 'package:syncrow_app/utils/helpers/custom_page_route.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
@@ -82,7 +84,11 @@ class RoomPageSwitch extends StatelessWidget {
|
||||
void showDeviceInterface(DeviceModel device, BuildContext context) {
|
||||
switch (device.productType) {
|
||||
case DeviceType.AC:
|
||||
navigateToInterface(ACsView(deviceModel: device), context);
|
||||
Navigator.push(
|
||||
context,
|
||||
PageRouteBuilder(
|
||||
pageBuilder: (context, animation1, animation2) => ACsView(deviceModel: device)));
|
||||
// navigateToInterface(ACsView(deviceModel: device), context);
|
||||
break;
|
||||
case DeviceType.WallSensor:
|
||||
navigateToInterface(WallMountedInterface(wallSensor: device), context);
|
||||
|
||||
+44
-84
@@ -3,8 +3,7 @@ class Assets {
|
||||
|
||||
/// Assets for assetsFontsAftikaRegular
|
||||
/// assets/fonts/AftikaRegular.ttf
|
||||
static const String assetsFontsAftikaRegular =
|
||||
"assets/fonts/AftikaRegular.ttf";
|
||||
static const String assetsFontsAftikaRegular = "assets/fonts/AftikaRegular.ttf";
|
||||
|
||||
/// Assets for assetsIcons3GangSwitch
|
||||
/// assets/icons/3GangSwitch.svg
|
||||
@@ -20,97 +19,81 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsAutomatedClock
|
||||
/// assets/icons/automated_clock.svg
|
||||
static const String assetsIconsAutomatedClock =
|
||||
"assets/icons/automated_clock.svg";
|
||||
static const String assetsIconsAutomatedClock = "assets/icons/automated_clock.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOffchargOfflowOffpmOffstChargeddmOff
|
||||
/// assets/icons/battery/dmOff/perOffchargOfflowOffpmOffstChargeddmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOffchargOfflowOffpmOffstChargeddmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOffchargOfflowOffpmOffstChargeddmOff =
|
||||
"assets/icons/battery/dmOff/perOffchargOfflowOffpmOffstChargeddmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOffchargOfflowOffpmOffstDefaultdmOff
|
||||
/// assets/icons/battery/dmOff/perOffchargOfflowOffpmOffstDefaultdmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOffchargOfflowOffpmOffstDefaultdmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOffchargOfflowOffpmOffstDefaultdmOff =
|
||||
"assets/icons/battery/dmOff/perOffchargOfflowOffpmOffstDefaultdmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOffchargOfflowOffpmOnstChargeddmOff
|
||||
/// assets/icons/battery/dmOff/perOffchargOfflowOffpmOnstChargeddmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOffchargOfflowOffpmOnstChargeddmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOffchargOfflowOffpmOnstChargeddmOff =
|
||||
"assets/icons/battery/dmOff/perOffchargOfflowOffpmOnstChargeddmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOffchargOfflowOnpmOffstDefaultdmOff
|
||||
/// assets/icons/battery/dmOff/perOffchargOfflowOnpmOffstDefaultdmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOffchargOfflowOnpmOffstDefaultdmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOffchargOfflowOnpmOffstDefaultdmOff =
|
||||
"assets/icons/battery/dmOff/perOffchargOfflowOnpmOffstDefaultdmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOffchargOfflowOnpmOnstDefaultdmOff
|
||||
/// assets/icons/battery/dmOff/perOffchargOfflowOnpmOnstDefaultdmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOffchargOfflowOnpmOnstDefaultdmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOffchargOfflowOnpmOnstDefaultdmOff =
|
||||
"assets/icons/battery/dmOff/perOffchargOfflowOnpmOnstDefaultdmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOffchargOnlowOffpmOffstChargeddmOff
|
||||
/// assets/icons/battery/dmOff/perOffchargOnlowOffpmOffstChargeddmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOffchargOnlowOffpmOffstChargeddmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOffchargOnlowOffpmOffstChargeddmOff =
|
||||
"assets/icons/battery/dmOff/perOffchargOnlowOffpmOffstChargeddmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOffchargOnlowOnpmOffstlowBatterydmOff
|
||||
/// assets/icons/battery/dmOff/perOffchargOnlowOnpmOffstlowBatterydmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOffchargOnlowOnpmOffstlowBatterydmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOffchargOnlowOnpmOffstlowBatterydmOff =
|
||||
"assets/icons/battery/dmOff/perOffchargOnlowOnpmOffstlowBatterydmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOffchargOnlowOnpmOnstlowpmdmOff
|
||||
/// assets/icons/battery/dmOff/perOffchargOnlowOnpmOnstlowpmdmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOffchargOnlowOnpmOnstlowpmdmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOffchargOnlowOnpmOnstlowpmdmOff =
|
||||
"assets/icons/battery/dmOff/perOffchargOnlowOnpmOnstlowpmdmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOnchargOfflowOffpmOffstChargeddmOff
|
||||
/// assets/icons/battery/dmOff/perOnchargOfflowOffpmOffstChargeddmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOnchargOfflowOffpmOffstChargeddmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOnchargOfflowOffpmOffstChargeddmOff =
|
||||
"assets/icons/battery/dmOff/perOnchargOfflowOffpmOffstChargeddmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOnchargOfflowOffpmOffstDefaultdmOff
|
||||
/// assets/icons/battery/dmOff/perOnchargOfflowOffpmOffstDefaultdmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOnchargOfflowOffpmOffstDefaultdmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOnchargOfflowOffpmOffstDefaultdmOff =
|
||||
"assets/icons/battery/dmOff/perOnchargOfflowOffpmOffstDefaultdmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOnchargOfflowOffpmOnstChargeddmOff
|
||||
/// assets/icons/battery/dmOff/perOnchargOfflowOffpmOnstChargeddmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOnchargOfflowOffpmOnstChargeddmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOnchargOfflowOffpmOnstChargeddmOff =
|
||||
"assets/icons/battery/dmOff/perOnchargOfflowOffpmOnstChargeddmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOnchargOfflowOnpmOffstDefaultdmOff
|
||||
/// assets/icons/battery/dmOff/perOnchargOfflowOnpmOffstDefaultdmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOnchargOfflowOnpmOffstDefaultdmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOnchargOfflowOnpmOffstDefaultdmOff =
|
||||
"assets/icons/battery/dmOff/perOnchargOfflowOnpmOffstDefaultdmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOnchargOfflowOnpmOnstDefaultdmOff
|
||||
/// assets/icons/battery/dmOff/perOnchargOfflowOnpmOnstDefaultdmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOnchargOfflowOnpmOnstDefaultdmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOnchargOfflowOnpmOnstDefaultdmOff =
|
||||
"assets/icons/battery/dmOff/perOnchargOfflowOnpmOnstDefaultdmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOnchargOnlowOffpmOffstChargeddmOff
|
||||
/// assets/icons/battery/dmOff/perOnchargOnlowOffpmOffstChargeddmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOnchargOnlowOffpmOffstChargeddmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOnchargOnlowOffpmOffstChargeddmOff =
|
||||
"assets/icons/battery/dmOff/perOnchargOnlowOffpmOffstChargeddmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOnchargOnlowOnpmOffstlowBatterydmOff
|
||||
/// assets/icons/battery/dmOff/perOnchargOnlowOnpmOffstlowBatterydmOff.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOffPerOnchargOnlowOnpmOffstlowBatterydmOff =
|
||||
static const String assetsIconsBatteryDmOffPerOnchargOnlowOnpmOffstlowBatterydmOff =
|
||||
"assets/icons/battery/dmOff/perOnchargOnlowOnpmOffstlowBatterydmOff.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOffPerOnchargOnlowOnpmOnstlowpmdmOff
|
||||
@@ -120,44 +103,37 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOffchargOfflowOffpmOffstChargeddmOn
|
||||
/// assets/icons/battery/dmOn/perOffchargOfflowOffpmOffstChargeddmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOffchargOfflowOffpmOffstChargeddmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOffchargOfflowOffpmOffstChargeddmOn =
|
||||
"assets/icons/battery/dmOn/perOffchargOfflowOffpmOffstChargeddmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOffchargOfflowOffpmOffstDefaultdmOn
|
||||
/// assets/icons/battery/dmOn/perOffchargOfflowOffpmOffstDefaultdmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOffchargOfflowOffpmOffstDefaultdmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOffchargOfflowOffpmOffstDefaultdmOn =
|
||||
"assets/icons/battery/dmOn/perOffchargOfflowOffpmOffstDefaultdmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOffchargOfflowOffpmOnstChargeddmOn
|
||||
/// assets/icons/battery/dmOn/perOffchargOfflowOffpmOnstChargeddmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOffchargOfflowOffpmOnstChargeddmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOffchargOfflowOffpmOnstChargeddmOn =
|
||||
"assets/icons/battery/dmOn/perOffchargOfflowOffpmOnstChargeddmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOffchargOfflowOnpmOffstDefaultdmOn
|
||||
/// assets/icons/battery/dmOn/perOffchargOfflowOnpmOffstDefaultdmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOffchargOfflowOnpmOffstDefaultdmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOffchargOfflowOnpmOffstDefaultdmOn =
|
||||
"assets/icons/battery/dmOn/perOffchargOfflowOnpmOffstDefaultdmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOffchargOfflowOnpmOnstDefaultdmOn
|
||||
/// assets/icons/battery/dmOn/perOffchargOfflowOnpmOnstDefaultdmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOffchargOfflowOnpmOnstDefaultdmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOffchargOfflowOnpmOnstDefaultdmOn =
|
||||
"assets/icons/battery/dmOn/perOffchargOfflowOnpmOnstDefaultdmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOffchargOnlowOffpmOffstChargeddmOn
|
||||
/// assets/icons/battery/dmOn/perOffchargOnlowOffpmOffstChargeddmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOffchargOnlowOffpmOffstChargeddmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOffchargOnlowOffpmOffstChargeddmOn =
|
||||
"assets/icons/battery/dmOn/perOffchargOnlowOffpmOffstChargeddmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOffchargOnlowOnpmOffstlowBatterydmOn
|
||||
/// assets/icons/battery/dmOn/perOffchargOnlowOnpmOffstlowBatterydmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOffchargOnlowOnpmOffstlowBatterydmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOffchargOnlowOnpmOffstlowBatterydmOn =
|
||||
"assets/icons/battery/dmOn/perOffchargOnlowOnpmOffstlowBatterydmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOffchargOnlowOnpmOnstlowpmdmOn
|
||||
@@ -167,44 +143,37 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOnchargOfflowOffpmOffstChargeddmOn
|
||||
/// assets/icons/battery/dmOn/perOnchargOfflowOffpmOffstChargeddmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOnchargOfflowOffpmOffstChargeddmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOnchargOfflowOffpmOffstChargeddmOn =
|
||||
"assets/icons/battery/dmOn/perOnchargOfflowOffpmOffstChargeddmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOnchargOfflowOffpmOffstDefaultdmOn
|
||||
/// assets/icons/battery/dmOn/perOnchargOfflowOffpmOffstDefaultdmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOnchargOfflowOffpmOffstDefaultdmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOnchargOfflowOffpmOffstDefaultdmOn =
|
||||
"assets/icons/battery/dmOn/perOnchargOfflowOffpmOffstDefaultdmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOnchargOfflowOffpmOnstChargeddmOn
|
||||
/// assets/icons/battery/dmOn/perOnchargOfflowOffpmOnstChargeddmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOnchargOfflowOffpmOnstChargeddmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOnchargOfflowOffpmOnstChargeddmOn =
|
||||
"assets/icons/battery/dmOn/perOnchargOfflowOffpmOnstChargeddmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOnchargOfflowOnpmOffstDefaultdmOn
|
||||
/// assets/icons/battery/dmOn/perOnchargOfflowOnpmOffstDefaultdmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOnchargOfflowOnpmOffstDefaultdmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOnchargOfflowOnpmOffstDefaultdmOn =
|
||||
"assets/icons/battery/dmOn/perOnchargOfflowOnpmOffstDefaultdmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOnchargOfflowOnpmOnstDefaultdmOn
|
||||
/// assets/icons/battery/dmOn/perOnchargOfflowOnpmOnstDefaultdmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOnchargOfflowOnpmOnstDefaultdmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOnchargOfflowOnpmOnstDefaultdmOn =
|
||||
"assets/icons/battery/dmOn/perOnchargOfflowOnpmOnstDefaultdmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOnchargOnlowOffpmOffstChargeddmOn
|
||||
/// assets/icons/battery/dmOn/perOnchargOnlowOffpmOffstChargeddmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOnchargOnlowOffpmOffstChargeddmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOnchargOnlowOffpmOffstChargeddmOn =
|
||||
"assets/icons/battery/dmOn/perOnchargOnlowOffpmOffstChargeddmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOnchargOnlowOnpmOffstlowBatterydmOn
|
||||
/// assets/icons/battery/dmOn/perOnchargOnlowOnpmOffstlowBatterydmOn.svg
|
||||
static const String
|
||||
assetsIconsBatteryDmOnPerOnchargOnlowOnpmOffstlowBatterydmOn =
|
||||
static const String assetsIconsBatteryDmOnPerOnchargOnlowOnpmOffstlowBatterydmOn =
|
||||
"assets/icons/battery/dmOn/perOnchargOnlowOnpmOffstlowBatterydmOn.svg";
|
||||
|
||||
/// Assets for assetsIconsBatteryDmOnPerOnchargOnlowOnpmOnstlowpmdmOn
|
||||
@@ -254,8 +223,7 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsDashboardFill
|
||||
/// assets/icons/dashboard-fill.svg
|
||||
static const String assetsIconsDashboardFill =
|
||||
"assets/icons/dashboard-fill.svg";
|
||||
static const String assetsIconsDashboardFill = "assets/icons/dashboard-fill.svg";
|
||||
|
||||
/// Assets for assetsIconsDevices
|
||||
/// assets/icons/Devices.svg
|
||||
@@ -271,8 +239,7 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsDoorLockLinkage
|
||||
/// assets/icons/DoorLockLinkage.svg
|
||||
static const String assetsIconsDoorLockLinkage =
|
||||
"assets/icons/DoorLockLinkage.svg";
|
||||
static const String assetsIconsDoorLockLinkage = "assets/icons/DoorLockLinkage.svg";
|
||||
|
||||
/// Assets for assetsIconsDoorLockLock
|
||||
/// assets/icons/DoorLockLock.svg
|
||||
@@ -280,18 +247,15 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsDoorLockMembers
|
||||
/// assets/icons/DoorLockMembers.svg
|
||||
static const String assetsIconsDoorLockMembers =
|
||||
"assets/icons/DoorLockMembers.svg";
|
||||
static const String assetsIconsDoorLockMembers = "assets/icons/DoorLockMembers.svg";
|
||||
|
||||
/// Assets for assetsIconsDoorLockPassword
|
||||
/// assets/icons/DoorLockPassword.svg
|
||||
static const String assetsIconsDoorLockPassword =
|
||||
"assets/icons/DoorLockPassword.svg";
|
||||
static const String assetsIconsDoorLockPassword = "assets/icons/DoorLockPassword.svg";
|
||||
|
||||
/// Assets for assetsIconsDoorLockRecords
|
||||
/// assets/icons/DoorLockRecords.svg
|
||||
static const String assetsIconsDoorLockRecords =
|
||||
"assets/icons/DoorLockRecords.svg";
|
||||
static const String assetsIconsDoorLockRecords = "assets/icons/DoorLockRecords.svg";
|
||||
|
||||
/// Assets for assetsIconsDoorlockAssetsBatteryIndicator
|
||||
/// assets/icons/doorlock-assets/BatteryIndicator.svg
|
||||
@@ -399,13 +363,11 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsLightSwitchOff
|
||||
/// assets/icons/lightSwitchOff.svg
|
||||
static const String assetsIconsLightSwitchOff =
|
||||
"assets/icons/lightSwitchOff.svg";
|
||||
static const String assetsIconsLightSwitchOff = "assets/icons/lightSwitchOff.svg";
|
||||
|
||||
/// Assets for assetsIconsLightSwitchOn
|
||||
/// assets/icons/lightSwitchOn.svg
|
||||
static const String assetsIconsLightSwitchOn =
|
||||
"assets/icons/lightSwitchOn.svg";
|
||||
static const String assetsIconsLightSwitchOn = "assets/icons/lightSwitchOn.svg";
|
||||
|
||||
/// Assets for assetsIconsLinkageIconsDoorLockAlarm
|
||||
/// assets/icons/linkageIcons/doorLockAlarm.svg
|
||||
@@ -421,6 +383,8 @@ class Assets {
|
||||
/// assets/icons/lock.svg
|
||||
static const String assetsIconsLock = "assets/icons/lock.svg";
|
||||
|
||||
static const String assetsIconsUnLock = "assets/icons/unlock_ic.svg";
|
||||
|
||||
/// Assets for assetsIconsLogo
|
||||
/// assets/icons/logo.png
|
||||
static const String assetsIconsLogo = "assets/icons/logo.png";
|
||||
@@ -597,8 +561,7 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsRoutinesFill
|
||||
/// assets/icons/Routines-fill.svg
|
||||
static const String assetsIconsRoutinesFill =
|
||||
"assets/icons/Routines-fill.svg";
|
||||
static const String assetsIconsRoutinesFill = "assets/icons/Routines-fill.svg";
|
||||
|
||||
/// Assets for assetsIconsScan
|
||||
/// assets/icons/Scan.svg
|
||||
@@ -630,8 +593,7 @@ class Assets {
|
||||
|
||||
/// Assets for assetsIconsSustainability
|
||||
/// assets/icons/sustainability.svg
|
||||
static const String assetsIconsSustainability =
|
||||
"assets/icons/sustainability.svg";
|
||||
static const String assetsIconsSustainability = "assets/icons/sustainability.svg";
|
||||
|
||||
/// Assets for assetsIconsUnlockingMethodsIconsFace
|
||||
/// assets/icons/unlockingMethodsIcons/face.svg
|
||||
@@ -710,8 +672,7 @@ class Assets {
|
||||
|
||||
/// Assets for assetsImagesHorizintalBlade
|
||||
/// assets/images/HorizintalBlade.png
|
||||
static const String assetsImagesHorizintalBlade =
|
||||
"assets/images/HorizintalBlade.png";
|
||||
static const String assetsImagesHorizintalBlade = "assets/images/HorizintalBlade.png";
|
||||
|
||||
/// Assets for assetsImagesLogo
|
||||
/// assets/images/Logo.svg
|
||||
@@ -719,8 +680,7 @@ class Assets {
|
||||
|
||||
/// Assets for assetsImagesLogoHorizontal
|
||||
/// assets/images/logo_horizontal.png
|
||||
static const String assetsImagesLogoHorizontal =
|
||||
"assets/images/logo_horizontal.png";
|
||||
static const String assetsImagesLogoHorizontal = "assets/images/logo_horizontal.png";
|
||||
|
||||
/// Assets for assetsImagesPause
|
||||
/// assets/images/Pause.png
|
||||
|
||||
@@ -72,9 +72,7 @@ Map<String, DeviceType> devicesTypesMap = {
|
||||
Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
DeviceType.AC: [
|
||||
FunctionModel(
|
||||
code: 'switch',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
code: 'switch', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'mode',
|
||||
type: functionTypesMap['Enum'],
|
||||
@@ -97,9 +95,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
// "range": ["low", "middle", "high", "auto"]
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'child_lock',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
code: 'child_lock', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
],
|
||||
DeviceType.Gateway: [
|
||||
FunctionModel(
|
||||
@@ -113,9 +109,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
"range": ["normal", "alarm"]
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'factory_reset',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
code: 'factory_reset', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'alarm_active',
|
||||
type: functionTypesMap['String'],
|
||||
@@ -125,8 +119,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
FunctionModel(
|
||||
code: 'sensitivity',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "", "min": 1, "max": 10, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 10, "scale": 0, "step": 1})),
|
||||
],
|
||||
DeviceType.DoorLock: [
|
||||
FunctionModel(
|
||||
@@ -134,9 +127,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
type: functionTypesMap['Raw'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'remote_no_dp_key',
|
||||
type: functionTypesMap['Raw'],
|
||||
values: ValueModel.fromJson({})),
|
||||
code: 'remote_no_dp_key', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'normal_open_switch',
|
||||
type: functionTypesMap['Boolean'],
|
||||
@@ -146,56 +137,42 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
FunctionModel(
|
||||
code: 'far_detection',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "cm", "min": 75, "max": 600, "scale": 0, "step": 75})),
|
||||
values: ValueModel.fromJson({"unit": "cm", "min": 75, "max": 600, "scale": 0, "step": 75})),
|
||||
FunctionModel(
|
||||
code: 'presence_time',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "Min", "min": 0, "max": 65535, "scale": 0, "step": 1})),
|
||||
values:
|
||||
ValueModel.fromJson({"unit": "Min", "min": 0, "max": 65535, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'motion_sensitivity_value',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'motionless_sensitivity',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'indicator',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
code: 'indicator', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
],
|
||||
DeviceType.ThreeGang: [
|
||||
FunctionModel(
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_2',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_3',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
code: 'switch_3', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_2',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_3',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
],
|
||||
};
|
||||
|
||||
@@ -342,11 +319,7 @@ List<Map<String, Object>> menuSections = [
|
||||
'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsMessages,
|
||||
'page': null
|
||||
},
|
||||
{
|
||||
'title': 'FAQs',
|
||||
'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsFAQs,
|
||||
'page': null
|
||||
},
|
||||
{'title': 'FAQs', 'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsFAQs, 'page': null},
|
||||
{
|
||||
'title': 'Help & Feedback',
|
||||
'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsHelpAndFeedback,
|
||||
@@ -376,11 +349,7 @@ List<Map<String, Object>> menuSections = [
|
||||
'title': 'Legal Information',
|
||||
'color': const Color(0xFF001B72),
|
||||
'buttons': [
|
||||
{
|
||||
'title': 'About',
|
||||
'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsAbout,
|
||||
'page': null
|
||||
},
|
||||
{'title': 'About', 'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsAbout, 'page': null},
|
||||
{
|
||||
'title': 'Privacy Policy',
|
||||
'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsPrivacyPolicy,
|
||||
|
||||
Reference in New Issue
Block a user