From c8e540e9383d3c39bd64ce1a084ae1b0e6180623 Mon Sep 17 00:00:00 2001 From: Faris Armoush Date: Thu, 24 Apr 2025 14:29:18 +0300 Subject: [PATCH] Remove unnecessary event dispatch in FlushMountedPresenceSensorBlocFactory creation --- .../factories/flush_mounted_presence_sensor_bloc_factory.dart | 2 +- .../views/flush_mounted_presence_sensor_batch_control_view.dart | 2 +- .../views/flush_mounted_presence_sensor_control_view.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pages/device_managment/flush_mounted_presence_sensor/factories/flush_mounted_presence_sensor_bloc_factory.dart b/lib/pages/device_managment/flush_mounted_presence_sensor/factories/flush_mounted_presence_sensor_bloc_factory.dart index f1342eec..49fb517f 100644 --- a/lib/pages/device_managment/flush_mounted_presence_sensor/factories/flush_mounted_presence_sensor_bloc_factory.dart +++ b/lib/pages/device_managment/flush_mounted_presence_sensor/factories/flush_mounted_presence_sensor_bloc_factory.dart @@ -16,6 +16,6 @@ abstract final class FlushMountedPresenceSensorBlocFactory { batchControlDevicesService: DebouncedBatchControlDevicesService( decoratee: RemoteBatchControlDevicesService(), ), - )..add(FlushMountedPresenceSensorFetchStatusEvent()); + ); } } diff --git a/lib/pages/device_managment/flush_mounted_presence_sensor/views/flush_mounted_presence_sensor_batch_control_view.dart b/lib/pages/device_managment/flush_mounted_presence_sensor/views/flush_mounted_presence_sensor_batch_control_view.dart index 25cbba09..78db6e2e 100644 --- a/lib/pages/device_managment/flush_mounted_presence_sensor/views/flush_mounted_presence_sensor_batch_control_view.dart +++ b/lib/pages/device_managment/flush_mounted_presence_sensor/views/flush_mounted_presence_sensor_batch_control_view.dart @@ -22,7 +22,7 @@ class FlushMountedPresenceSensorBatchControlView extends StatelessWidget return BlocProvider( create: (context) => FlushMountedPresenceSensorBlocFactory.create( deviceId: devicesIds.first, - ), + )..add(FlushMountedPresenceSensorFetchBatchStatusEvent(devicesIds)), child: BlocBuilder( builder: (context, state) { diff --git a/lib/pages/device_managment/flush_mounted_presence_sensor/views/flush_mounted_presence_sensor_control_view.dart b/lib/pages/device_managment/flush_mounted_presence_sensor/views/flush_mounted_presence_sensor_control_view.dart index bdefa507..f0815c60 100644 --- a/lib/pages/device_managment/flush_mounted_presence_sensor/views/flush_mounted_presence_sensor_control_view.dart +++ b/lib/pages/device_managment/flush_mounted_presence_sensor/views/flush_mounted_presence_sensor_control_view.dart @@ -24,7 +24,7 @@ class FlushMountedPresenceSensorControlView extends StatelessWidget return BlocProvider( create: (context) => FlushMountedPresenceSensorBlocFactory.create( deviceId: device.uuid ?? '-1', - ), + )..add(FlushMountedPresenceSensorFetchStatusEvent()), child: BlocBuilder( builder: (context, state) {