From 53eb18c075a4d24e5ca23edda3dadb8ef46a44fb Mon Sep 17 00:00:00 2001 From: ashrafzarkanisala Date: Sat, 23 Nov 2024 00:54:52 +0300 Subject: [PATCH] push ac function state selection --- lib/main.dart | 2 +- .../functions_bloc/functions_bloc_bloc.dart | 148 +++++++ .../functions_bloc/functions_bloc_event.dart | 72 ++++ .../functions_bloc/functions_bloc_state.dart | 24 ++ .../bloc/{ => routine_bloc}/routine_bloc.dart | 0 .../{ => routine_bloc}/routine_event.dart | 0 .../{ => routine_bloc}/routine_state.dart | 0 lib/pages/routiens/helper/ac_helper.dart | 388 +++++++++--------- .../routiens/models/device_functions.dart | 25 ++ .../conditions_routines_devices_view.dart | 2 +- lib/pages/routiens/widgets/dragable_card.dart | 2 +- lib/pages/routiens/widgets/if_container.dart | 2 +- .../routiens/widgets/routine_devices.dart | 2 +- .../widgets/scenes_and_automations.dart | 2 +- .../routiens/widgets/then_container.dart | 2 +- 15 files changed, 475 insertions(+), 196 deletions(-) create mode 100644 lib/pages/routiens/bloc/functions_bloc/functions_bloc_bloc.dart create mode 100644 lib/pages/routiens/bloc/functions_bloc/functions_bloc_event.dart create mode 100644 lib/pages/routiens/bloc/functions_bloc/functions_bloc_state.dart rename lib/pages/routiens/bloc/{ => routine_bloc}/routine_bloc.dart (100%) rename lib/pages/routiens/bloc/{ => routine_bloc}/routine_event.dart (100%) rename lib/pages/routiens/bloc/{ => routine_bloc}/routine_state.dart (100%) diff --git a/lib/main.dart b/lib/main.dart index ac002f85..2040d175 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,7 +6,7 @@ import 'package:go_router/go_router.dart'; import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart'; import 'package:syncrow_web/pages/home/bloc/home_bloc.dart'; import 'package:syncrow_web/pages/home/bloc/home_event.dart'; -import 'package:syncrow_web/pages/routiens/bloc/routine_bloc.dart'; +import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart'; import 'package:syncrow_web/pages/visitor_password/bloc/visitor_password_bloc.dart'; import 'package:syncrow_web/services/locator.dart'; import 'package:syncrow_web/utils/app_routes.dart'; diff --git a/lib/pages/routiens/bloc/functions_bloc/functions_bloc_bloc.dart b/lib/pages/routiens/bloc/functions_bloc/functions_bloc_bloc.dart new file mode 100644 index 00000000..54b47cad --- /dev/null +++ b/lib/pages/routiens/bloc/functions_bloc/functions_bloc_bloc.dart @@ -0,0 +1,148 @@ +import 'package:bloc/bloc.dart'; +import 'package:equatable/equatable.dart'; +import 'package:flutter/material.dart'; +import 'package:syncrow_web/pages/routiens/models/device_functions.dart'; + +part 'functions_bloc_event.dart'; +part 'functions_bloc_state.dart'; + +class FunctionBloc extends Bloc { + FunctionBloc() : super(const FunctionBlocState()) { + on(_onInitializeFunctions); + on(_onAddFunction); + on(_onUpdateFunctions); + on(_onUpdateFunctionValue); + on(_onUpdateFunctionCondition); + on(_onRemoveFunction); + } + + void _onAddFunction(AddFunction event, Emitter emit) { + debugPrint('Adding function: ${event.functionData.function}'); + final functions = List.from(state.functions); + + // Find existing function data + final existingIndex = functions.indexWhere( + (f) => f.function == event.functionData.function, + ); + + // If function exists, preserve its value and condition + if (existingIndex != -1) { + final existingData = functions[existingIndex]; + functions[existingIndex] = DeviceFunctionData( + entityId: event.functionData.entityId, + function: event.functionData.function, + operationName: event.functionData.operationName, + value: existingData.value, // Preserve the existing value + condition: existingData.condition, // Preserve the existing condition + ); + } else { + functions.add(event.functionData); + } + + debugPrint('Functions after add: $functions'); + emit(state.copyWith( + functions: functions, + selectedFunction: event.functionData.function, + )); + } + + void _onUpdateFunctions( + UpdateFunction event, Emitter emit) { + final functions = state.functions.map((data) { + return data.function == event.functionData.function + ? event.functionData + : data; + }).toList(); + + emit(state.copyWith(functions: functions)); + } + + void _onUpdateFunctionValue( + UpdateFunctionValue event, + Emitter emit, + ) { + debugPrint('Updating function value: ${event.function} -> ${event.value}'); + + // Create a new list to ensure state immutability + final functions = List.from(state.functions); + + // Find the index of the function to update + final functionIndex = functions.indexWhere( + (data) => data.function == event.function, + ); + + if (functionIndex != -1) { + // Update the existing function data while preserving other fields + final existingData = functions[functionIndex]; + functions[functionIndex] = DeviceFunctionData( + entityId: existingData.entityId, + function: existingData.function, + operationName: existingData.operationName, + value: event.value, + condition: existingData.condition, + ); + } else { + // If function doesn't exist, add it + functions.add(DeviceFunctionData( + entityId: '', + function: event.function, + operationName: '', + value: event.value, + )); + } + + debugPrint('Functions after update: $functions'); + emit(state.copyWith(functions: functions)); + } + + void _onUpdateFunctionCondition( + UpdateFunctionCondition event, + Emitter emit, + ) { + final functions = state.functions.map((data) { + if (data.function == event.function) { + return DeviceFunctionData( + entityId: data.entityId, + function: data.function, + operationName: data.operationName, + value: data.value, + condition: event.condition, + ); + } + return data; + }).toList(); + + emit(state.copyWith(functions: functions)); + } + + void _onRemoveFunction( + RemoveFunction event, Emitter emit) { + final functions = state.functions + .where((data) => data.function != event.functionCode) + .toList(); + + emit(state.copyWith( + functions: functions, + selectedFunction: functions.isEmpty ? null : state.selectedFunction, + )); + } + + void _onInitializeFunctions( + InitializeFunctions event, + Emitter emit, + ) { + emit(state.copyWith(functions: event.functions)); + } + + DeviceFunctionData? getFunction(String functionCode) { + return state.functions.firstWhere( + (data) => data.function == functionCode, + orElse: () => DeviceFunctionData( + entityId: '', + function: functionCode, + operationName: '', + value: null, + ), + ); + } +} diff --git a/lib/pages/routiens/bloc/functions_bloc/functions_bloc_event.dart b/lib/pages/routiens/bloc/functions_bloc/functions_bloc_event.dart new file mode 100644 index 00000000..cceb6d21 --- /dev/null +++ b/lib/pages/routiens/bloc/functions_bloc/functions_bloc_event.dart @@ -0,0 +1,72 @@ +part of 'functions_bloc_bloc.dart'; + +abstract class FunctionBlocEvent extends Equatable { + const FunctionBlocEvent(); + + @override + List get props => []; +} + +class AddFunction extends FunctionBlocEvent { + final DeviceFunctionData functionData; + + const AddFunction({ + required this.functionData, + }); + + @override + List get props => [functionData]; +} + +class UpdateFunction extends FunctionBlocEvent { + final DeviceFunctionData functionData; + + const UpdateFunction(this.functionData); + + @override + List get props => [functionData]; +} + +class UpdateFunctionValue extends FunctionBlocEvent { + final String function; + final dynamic value; + + const UpdateFunctionValue({ + required this.function, + required this.value, + }); + + @override + List get props => [function, value]; +} + +class UpdateFunctionCondition extends FunctionBlocEvent { + final String function; + final String condition; + + const UpdateFunctionCondition({ + required this.function, + required this.condition, + }); + + @override + List get props => [function, condition]; +} + +class RemoveFunction extends FunctionBlocEvent { + final String functionCode; + + const RemoveFunction(this.functionCode); + + @override + List get props => [functionCode]; +} + +class InitializeFunctions extends FunctionBlocEvent { + final List functions; + + const InitializeFunctions(this.functions); + + @override + List get props => [functions]; +} diff --git a/lib/pages/routiens/bloc/functions_bloc/functions_bloc_state.dart b/lib/pages/routiens/bloc/functions_bloc/functions_bloc_state.dart new file mode 100644 index 00000000..af854b8a --- /dev/null +++ b/lib/pages/routiens/bloc/functions_bloc/functions_bloc_state.dart @@ -0,0 +1,24 @@ +part of 'functions_bloc_bloc.dart'; + +class FunctionBlocState extends Equatable { + final List functions; + final String? selectedFunction; + + const FunctionBlocState({ + this.functions = const [], + this.selectedFunction, + }); + + FunctionBlocState copyWith({ + List? functions, + String? selectedFunction, + }) { + return FunctionBlocState( + functions: functions ?? this.functions, + selectedFunction: selectedFunction ?? this.selectedFunction, + ); + } + + @override + List get props => [functions, selectedFunction]; +} diff --git a/lib/pages/routiens/bloc/routine_bloc.dart b/lib/pages/routiens/bloc/routine_bloc/routine_bloc.dart similarity index 100% rename from lib/pages/routiens/bloc/routine_bloc.dart rename to lib/pages/routiens/bloc/routine_bloc/routine_bloc.dart diff --git a/lib/pages/routiens/bloc/routine_event.dart b/lib/pages/routiens/bloc/routine_bloc/routine_event.dart similarity index 100% rename from lib/pages/routiens/bloc/routine_event.dart rename to lib/pages/routiens/bloc/routine_bloc/routine_event.dart diff --git a/lib/pages/routiens/bloc/routine_state.dart b/lib/pages/routiens/bloc/routine_bloc/routine_state.dart similarity index 100% rename from lib/pages/routiens/bloc/routine_state.dart rename to lib/pages/routiens/bloc/routine_bloc/routine_state.dart diff --git a/lib/pages/routiens/helper/ac_helper.dart b/lib/pages/routiens/helper/ac_helper.dart index d940f4e4..327d0787 100644 --- a/lib/pages/routiens/helper/ac_helper.dart +++ b/lib/pages/routiens/helper/ac_helper.dart @@ -6,6 +6,8 @@ import 'package:syncrow_web/pages/routiens/widgets/dialog_footer.dart'; import 'package:syncrow_web/pages/routiens/widgets/dialog_header.dart'; import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/extension/build_context_x.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:syncrow_web/pages/routiens/bloc/functions_bloc/functions_bloc_bloc.dart'; class ACHelper { static Future?> showACFunctionsDialog( @@ -13,97 +15,122 @@ class ACHelper { List> functions, ) async { List acFunctions = functions.whereType().toList(); - final selectedFunctionNotifier = ValueNotifier(null); - final selectedValueNotifier = ValueNotifier(null); - final selectedConditionNotifier = ValueNotifier('=='); - final selectedConditionsNotifier = - ValueNotifier>([false, true, false]); + + // Initialize the FunctionBloc with existing functions + final initialFunctions = acFunctions + .map((f) => DeviceFunctionData( + entityId: '', + function: f.code, + operationName: f.operationName, + value: null, + )) + .toList(); return showDialog?>( context: context, builder: (BuildContext context) { - return ValueListenableBuilder( - valueListenable: selectedFunctionNotifier, - builder: (context, selectedFunction, _) { - return AlertDialog( - contentPadding: EdgeInsets.zero, - content: Container( - width: selectedFunction != null ? 600 : 360, - height: 450, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(20), - ), - padding: const EdgeInsets.only(top: 20), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - const DialogHeader('AC Functions'), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - // Function list - SizedBox( - width: selectedFunction != null ? 320 : 360, - child: _buildFunctionsList( - context, - acFunctions, - selectedFunctionNotifier, - ), - ), - // Value selector - if (selectedFunction != null) - Expanded( - child: _buildValueSelector( + return BlocProvider( + create: (_) => + FunctionBloc()..add(InitializeFunctions(initialFunctions)), + child: AlertDialog( + contentPadding: EdgeInsets.zero, + content: BlocBuilder( + builder: (context, state) { + debugPrint( + 'Current state - Selected: ${state.selectedFunction}, Functions: ${state.functions}'); + + final selectedFunction = state.selectedFunction; + final selectedFunctionData = selectedFunction != null + ? state.functions.firstWhere( + (f) => f.function == selectedFunction, + orElse: () => DeviceFunctionData( + entityId: '', + function: selectedFunction, + operationName: '', + value: null, + ), + ) + : null; + + return Container( + width: selectedFunction != null ? 600 : 360, + height: 450, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20), + ), + padding: const EdgeInsets.only(top: 20), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const DialogHeader('AC Functions'), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // Function list + SizedBox( + width: selectedFunction != null ? 320 : 360, + child: _buildFunctionsList( context, - selectedFunction, - selectedValueNotifier, - selectedConditionNotifier, - selectedConditionsNotifier, acFunctions, + (functionCode) => + context.read().add( + AddFunction( + functionData: DeviceFunctionData( + entityId: '', + function: functionCode, + operationName: '', + value: null, + )), + ), ), ), - ], + // Value selector + if (selectedFunction != null) + Expanded( + child: _buildValueSelector( + context, + selectedFunction, + selectedFunctionData, + (value) => context.read().add( + UpdateFunctionValue( + function: selectedFunction, + value: value, + ), + ), + (condition) => + context.read().add( + UpdateFunctionCondition( + function: selectedFunction, + condition: condition, + ), + ), + acFunctions, + ), + ), + ], + ), ), - ), - DialogFooter( - onCancel: () { - selectedFunctionNotifier.dispose(); - selectedValueNotifier.dispose(); - selectedConditionNotifier.dispose(); - selectedConditionsNotifier.dispose(); - Navigator.pop(context); - }, - onConfirm: selectedFunctionNotifier.value != null && - selectedValueNotifier.value != null - ? () { - selectedFunctionNotifier.dispose(); - selectedValueNotifier.dispose(); - selectedConditionNotifier.dispose(); - selectedConditionsNotifier.dispose(); - Navigator.pop(context, { - 'function': selectedFunctionNotifier.value, - 'value': selectedValueNotifier.value, - 'condition': - selectedConditionNotifier.value ?? "==", - }); - } - : null, - isConfirmEnabled: selectedFunction != null, - ), - ], - ), - ), - ); - }, + DialogFooter( + onCancel: () { + Navigator.pop(context); + }, + onConfirm: selectedFunction != null && + selectedFunctionData?.value != null + ? () {} + : null, + isConfirmEnabled: selectedFunction != null, + ), + ], + ), + ); + }, + ), + ), ); }, ).then((value) { - selectedFunctionNotifier.dispose(); - selectedValueNotifier.dispose(); - selectedConditionNotifier.dispose(); - selectedConditionsNotifier.dispose(); return value; }); } @@ -112,7 +139,7 @@ class ACHelper { static Widget _buildFunctionsList( BuildContext context, List acFunctions, - ValueNotifier selectedFunctionNotifier, + Function(String) onFunctionSelected, ) { return ListView.separated( shrinkWrap: false, @@ -146,7 +173,7 @@ class ACHelper { size: 16, color: ColorsManager.textGray, ), - onTap: () => selectedFunctionNotifier.value = function.code, + onTap: () => onFunctionSelected(function.code), ); }, ); @@ -156,60 +183,57 @@ class ACHelper { static Widget _buildValueSelector( BuildContext context, String selectedFunction, - ValueNotifier selectedValueNotifier, - ValueNotifier selectedConditionNotifier, - ValueNotifier> selectedConditionsNotifier, + DeviceFunctionData? selectedFunctionData, + Function(dynamic) onValueChanged, + Function(String) onConditionChanged, List acFunctions, ) { - // Handle temperature functions if (selectedFunction == 'temp_set' || selectedFunction == 'temp_current') { - // Initialize with 20°C (200 in internal representation) - if (selectedValueNotifier.value == null || - selectedValueNotifier.value is! int) { - selectedValueNotifier.value = 200; - } + final initialValue = selectedFunctionData?.value ?? 200; return _buildTemperatureSelector( context, - selectedValueNotifier, - selectedConditionNotifier, - selectedConditionsNotifier, + initialValue, + selectedFunctionData?.condition, + onValueChanged, + onConditionChanged, ); } - // Handle other functions final selectedFn = acFunctions.firstWhere((f) => f.code == selectedFunction); final values = selectedFn.getOperationalValues(); - // Don't set any default value for non-temperature functions return _buildOperationalValuesList( context, values, - selectedValueNotifier, + selectedFunctionData?.value, + onValueChanged, ); } /// Build temperature selector for AC functions dialog static Widget _buildTemperatureSelector( BuildContext context, - ValueNotifier selectedValueNotifier, - ValueNotifier selectedConditionNotifier, - ValueNotifier> selectedConditionsNotifier, + dynamic initialValue, + String? currentCondition, + Function(dynamic) onValueChanged, + Function(String) onConditionChanged, ) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ _buildConditionToggle( context, - selectedConditionNotifier, - selectedConditionsNotifier, + currentCondition, + onConditionChanged, ), const SizedBox(height: 20), - _buildTemperatureDisplay(context, selectedValueNotifier), + _buildTemperatureDisplay(context, initialValue), const SizedBox(height: 20), _buildTemperatureSlider( context, - selectedValueNotifier, + initialValue, + onValueChanged, ), ], ); @@ -218,79 +242,61 @@ class ACHelper { /// Build condition toggle for AC functions dialog static Widget _buildConditionToggle( BuildContext context, - ValueNotifier selectedConditionNotifier, - ValueNotifier> selectedConditionsNotifier, + String? currentCondition, + Function(String) onConditionChanged, ) { - return ValueListenableBuilder>( - valueListenable: selectedConditionsNotifier, - builder: (context, selectedConditions, _) { - return ToggleButtons( - onPressed: (int index) { - final newConditions = [false, false, false]; - newConditions[index] = true; - selectedConditionsNotifier.value = newConditions; - selectedConditionNotifier.value = index == 0 - ? "<" - : index == 1 - ? "==" - : ">"; - }, - borderRadius: const BorderRadius.all(Radius.circular(8)), - selectedBorderColor: ColorsManager.primaryColorWithOpacity, - selectedColor: Colors.white, - fillColor: ColorsManager.primaryColorWithOpacity, - color: ColorsManager.primaryColorWithOpacity, - constraints: const BoxConstraints( - minHeight: 40.0, - minWidth: 40.0, - ), - isSelected: selectedConditions, - children: const [Text("<"), Text("="), Text(">")], - ); + final conditions = ["<", "==", ">"]; + + return ToggleButtons( + onPressed: (int index) { + onConditionChanged(conditions[index]); }, + borderRadius: const BorderRadius.all(Radius.circular(8)), + selectedBorderColor: ColorsManager.primaryColorWithOpacity, + selectedColor: Colors.white, + fillColor: ColorsManager.primaryColorWithOpacity, + color: ColorsManager.primaryColorWithOpacity, + constraints: const BoxConstraints( + minHeight: 40.0, + minWidth: 40.0, + ), + isSelected: + conditions.map((c) => c == (currentCondition ?? "==")).toList(), + children: conditions.map((c) => Text(c)).toList(), ); } /// Build temperature display for AC functions dialog static Widget _buildTemperatureDisplay( - BuildContext context, ValueNotifier selectedValueNotifier) { + BuildContext context, dynamic initialValue) { return Container( padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), decoration: BoxDecoration( color: ColorsManager.primaryColorWithOpacity.withOpacity(0.1), borderRadius: BorderRadius.circular(10), ), - child: ValueListenableBuilder( - valueListenable: selectedValueNotifier, - builder: (context, selectedValue, child) { - return Text( - '${(selectedValue ?? 200) / 10}°C', - style: context.textTheme.headlineMedium!.copyWith( - color: ColorsManager.primaryColorWithOpacity, - ), - ); - }, + child: Text( + '${(initialValue ?? 200) / 10}°C', + style: context.textTheme.headlineMedium!.copyWith( + color: ColorsManager.primaryColorWithOpacity, + ), ), ); } static Widget _buildTemperatureSlider( BuildContext context, - ValueNotifier selectedValueNotifier, + dynamic initialValue, + Function(dynamic) onValueChanged, ) { - return ValueListenableBuilder( - valueListenable: selectedValueNotifier, - builder: (context, selectedValue, child) { - final currentValue = - selectedValue is int ? selectedValue.toDouble() : 200.0; - return Slider( - value: currentValue, - min: 160, - max: 300, - divisions: 14, - label: '${(currentValue / 10).toInt()}°C', - onChanged: (value) => selectedValueNotifier.value = value.toInt(), - ); + return Slider( + value: initialValue is int ? initialValue.toDouble() : 200.0, + min: 160, + max: 300, + divisions: 14, + label: '${((initialValue ?? 200) / 10).toInt()}°C', + onChanged: (value) { + onValueChanged(value.toInt()); }, ); } @@ -298,40 +304,44 @@ class ACHelper { static Widget _buildOperationalValuesList( BuildContext context, List values, - ValueNotifier selectedValueNotifier, + dynamic selectedValue, + Function(dynamic) onValueChanged, ) { - return ValueListenableBuilder( - valueListenable: selectedValueNotifier, - builder: (context, selectedValue, _) { - return ListView.builder( - shrinkWrap: false, - physics: const AlwaysScrollableScrollPhysics(), - itemCount: values.length, - itemBuilder: (context, index) { - final value = values[index]; - return ListTile( - leading: SvgPicture.asset( - value.icon, - width: 24, - height: 24, - placeholderBuilder: (BuildContext context) => Container( - width: 24, - height: 24, - color: Colors.transparent, - ), - ), - title: Text( - value.description, - style: context.textTheme.bodyMedium, - ), - trailing: Radio( - value: value.value, - groupValue: selectedValue, - onChanged: (_) => selectedValueNotifier.value = value.value, - activeColor: ColorsManager.primaryColorWithOpacity, - ), - onTap: () => selectedValueNotifier.value = value.value, - ); + return ListView.builder( + shrinkWrap: false, + physics: const AlwaysScrollableScrollPhysics(), + itemCount: values.length, + itemBuilder: (context, index) { + final value = values[index]; + final isSelected = selectedValue == value.value; + return ListTile( + leading: SvgPicture.asset( + value.icon, + width: 24, + height: 24, + placeholderBuilder: (BuildContext context) => Container( + width: 24, + height: 24, + color: Colors.transparent, + ), + ), + title: Text( + value.description, + style: context.textTheme.bodyMedium, + ), + trailing: Icon( + isSelected + ? Icons.radio_button_checked + : Icons.radio_button_unchecked, + size: 24, + color: isSelected + ? ColorsManager.primaryColorWithOpacity + : ColorsManager.textGray, + ), + onTap: () { + if (!isSelected) { + onValueChanged(value.value); + } }, ); }, diff --git a/lib/pages/routiens/models/device_functions.dart b/lib/pages/routiens/models/device_functions.dart index 303fe48c..4234c812 100644 --- a/lib/pages/routiens/models/device_functions.dart +++ b/lib/pages/routiens/models/device_functions.dart @@ -58,4 +58,29 @@ class DeviceFunctionData { valueDescription: json['valueDescription'], ); } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + + return other is DeviceFunctionData && + other.entityId == entityId && + other.actionExecutor == actionExecutor && + other.function == function && + other.operationName == operationName && + other.value == value && + other.condition == condition && + other.valueDescription == valueDescription; + } + + @override + int get hashCode { + return entityId.hashCode ^ + actionExecutor.hashCode ^ + function.hashCode ^ + operationName.hashCode ^ + value.hashCode ^ + condition.hashCode ^ + valueDescription.hashCode; + } } diff --git a/lib/pages/routiens/widgets/conditions_routines_devices_view.dart b/lib/pages/routiens/widgets/conditions_routines_devices_view.dart index 2728d329..7bda1d51 100644 --- a/lib/pages/routiens/widgets/conditions_routines_devices_view.dart +++ b/lib/pages/routiens/widgets/conditions_routines_devices_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_web/pages/routiens/bloc/routine_bloc.dart'; +import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart'; import 'package:syncrow_web/pages/routiens/widgets/dragable_card.dart'; import 'package:syncrow_web/pages/routiens/widgets/routine_devices.dart'; import 'package:syncrow_web/pages/routiens/widgets/routines_title_widget.dart'; diff --git a/lib/pages/routiens/widgets/dragable_card.dart b/lib/pages/routiens/widgets/dragable_card.dart index 227e440b..016b82c1 100644 --- a/lib/pages/routiens/widgets/dragable_card.dart +++ b/lib/pages/routiens/widgets/dragable_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:syncrow_web/pages/routiens/bloc/routine_bloc.dart'; +import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart'; import 'package:syncrow_web/pages/routiens/models/device_functions.dart'; import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/extension/build_context_x.dart'; diff --git a/lib/pages/routiens/widgets/if_container.dart b/lib/pages/routiens/widgets/if_container.dart index af1394c6..779453f1 100644 --- a/lib/pages/routiens/widgets/if_container.dart +++ b/lib/pages/routiens/widgets/if_container.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_web/pages/routiens/bloc/routine_bloc.dart'; +import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart'; import 'package:syncrow_web/pages/routiens/helper/dialog_helper/device_dialog_helper.dart'; import 'package:syncrow_web/pages/routiens/widgets/dragable_card.dart'; diff --git a/lib/pages/routiens/widgets/routine_devices.dart b/lib/pages/routiens/widgets/routine_devices.dart index 7d97de18..0dc6e35e 100644 --- a/lib/pages/routiens/widgets/routine_devices.dart +++ b/lib/pages/routiens/widgets/routine_devices.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_mgmt_bloc/device_managment_bloc.dart'; -import 'package:syncrow_web/pages/routiens/bloc/routine_bloc.dart'; +import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart'; import 'package:syncrow_web/pages/routiens/widgets/dragable_card.dart'; class RoutineDevices extends StatelessWidget { diff --git a/lib/pages/routiens/widgets/scenes_and_automations.dart b/lib/pages/routiens/widgets/scenes_and_automations.dart index ef40b605..a74634ba 100644 --- a/lib/pages/routiens/widgets/scenes_and_automations.dart +++ b/lib/pages/routiens/widgets/scenes_and_automations.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_web/pages/routiens/bloc/routine_bloc.dart'; +import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart'; import 'package:syncrow_web/pages/routiens/widgets/dragable_card.dart'; import 'package:syncrow_web/utils/constants/assets.dart'; diff --git a/lib/pages/routiens/widgets/then_container.dart b/lib/pages/routiens/widgets/then_container.dart index 385ec4cb..e4df6d8b 100644 --- a/lib/pages/routiens/widgets/then_container.dart +++ b/lib/pages/routiens/widgets/then_container.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_web/pages/routiens/bloc/routine_bloc.dart'; +import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart'; import 'package:syncrow_web/pages/routiens/helper/dialog_helper/device_dialog_helper.dart'; import 'package:syncrow_web/pages/routiens/widgets/dragable_card.dart';