mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-27 18:54:55 +00:00
@ -16,12 +16,10 @@ class GateWayBloc extends Bloc<GateWayEvent, GateWayState> {
|
||||
on<GateWayFactoryReset>(_onFactoryReset);
|
||||
}
|
||||
|
||||
FutureOr<void> _getGatWayById(
|
||||
GatWayById event, Emitter<GateWayState> emit) async {
|
||||
FutureOr<void> _getGatWayById(GatWayById event, Emitter<GateWayState> emit) async {
|
||||
emit(GatewayLoadingState());
|
||||
try {
|
||||
final devicesList =
|
||||
await DevicesManagementApi.getDevicesByGatewayId(event.getWayId);
|
||||
List<DeviceModel> devicesList = await DevicesManagementApi.getDevicesByGatewayId(event.getWayId);
|
||||
|
||||
emit(UpdateGatewayState(list: devicesList));
|
||||
} catch (e) {
|
||||
@ -30,8 +28,7 @@ class GateWayBloc extends Bloc<GateWayEvent, GateWayState> {
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onFactoryReset(
|
||||
GateWayFactoryReset event, Emitter<GateWayState> emit) async {
|
||||
FutureOr<void> _onFactoryReset(GateWayFactoryReset event, Emitter<GateWayState> emit) async {
|
||||
emit(GatewayLoadingState());
|
||||
try {
|
||||
final response = await DevicesManagementApi().factoryReset(
|
||||
|
||||
@ -6,8 +6,7 @@ import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_
|
||||
// import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
|
||||
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||
|
||||
class GatewayBatchControlView extends StatelessWidget
|
||||
with HelperResponsiveLayout {
|
||||
class GatewayBatchControlView extends StatelessWidget with HelperResponsiveLayout {
|
||||
const GatewayBatchControlView({super.key, required this.gatewayIds});
|
||||
|
||||
final List<String> gatewayIds;
|
||||
@ -39,8 +38,7 @@ class GatewayBatchControlView extends StatelessWidget
|
||||
context.read<GateWayBloc>().add(
|
||||
GateWayFactoryReset(
|
||||
deviceId: gatewayIds.first,
|
||||
factoryReset:
|
||||
FactoryResetModel(devicesUuid: gatewayIds),
|
||||
factoryReset: FactoryResetModel(devicesUuid: gatewayIds),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@ -37,21 +37,21 @@ class GateWayControlsView extends StatelessWidget with HelperResponsiveLayout {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'Bluetooth Devices:',
|
||||
"Bluetooth Devices:",
|
||||
style: context.textTheme.bodyMedium!.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
'No devices found',
|
||||
"No devices found",
|
||||
style: context.textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.blackColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
'ZigBee Devices:',
|
||||
"ZigBee Devices:",
|
||||
style: context.textTheme.bodyMedium!.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user