From 23e54c7e78499aec7fec4bfa7bf7b4820061717d Mon Sep 17 00:00:00 2001 From: mohammad Date: Fri, 25 Oct 2024 20:17:34 +0300 Subject: [PATCH] batch_control --- .../power_clamp/bloc/smart_power_bloc.dart | 55 +------------------ 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/lib/pages/device_managment/power_clamp/bloc/smart_power_bloc.dart b/lib/pages/device_managment/power_clamp/bloc/smart_power_bloc.dart index 4f1bfc62..6d4033fa 100644 --- a/lib/pages/device_managment/power_clamp/bloc/smart_power_bloc.dart +++ b/lib/pages/device_managment/power_clamp/bloc/smart_power_bloc.dart @@ -260,7 +260,7 @@ class SmartPowerBloc extends Bloc { currentPage = event.page; emit(SmartPowerStatusLoaded(deviceStatus, currentPage)); } - + Future _onFactoryReset( SmartPowerFactoryReset event, Emitter emit) async { emit(SmartPowerLoading()); @@ -588,16 +588,14 @@ class SmartPowerBloc extends Bloc { TextButton( child: const Text('Cancel'), onPressed: () { - Navigator.of(context) - .pop(); // Pops without value, returning null + Navigator.of(context).pop(); // Pops without value, returning null }, ), TextButton( child: const Text('OK'), onPressed: () { final selectedDateTime = DateTime(selectedYear); - Navigator.of(context).pop( - selectedDateTime); // Pops with the selected date + Navigator.of(context).pop(selectedDateTime); // Pops with the selected date }, ), ], @@ -677,53 +675,6 @@ class SmartPowerBloc extends Bloc { DateTime? dateTime = DateTime.now(); String formattedDate = DateFormat('yyyy/MM/dd').format(DateTime.now()); - // void checkDayMonthYearSelected( - // SelectDateEvent event, Emitter emit) async { - // if (currentIndex == 0) { - // await dayMonthYearPicker(context: event.context).then( - // (newDate) { - // if (newDate != null) { - // dateTime = newDate; - // formattedDate = DateFormat('yyyy/MM/dd').format(dateTime!); - - // add(FilterRecordsByDateEvent( - // selectedDate: dateTime!, - // viewType: views[currentIndex], - // )); - // } - // }, - // ); - // } else if (currentIndex == 1) { - // await selectMonthAndYear(event.context).then( - // (newDate) { - // if (newDate != null) { - // dateTime = newDate; - // formattedDate = DateFormat('yyyy-MM').format(dateTime!); - - // add(FilterRecordsByDateEvent( - // selectedDate: dateTime!, - // viewType: views[currentIndex], - // )); - // } - // }, - // ); - // } else if (currentIndex == 2) { - // await selectYear(event.context).then( - // (newDate) { - // if (newDate != null) { - // dateTime = newDate; - // formattedDate = DateFormat('yyyy').format(dateTime!); - - // add(FilterRecordsByDateEvent( - // selectedDate: dateTime!, - // viewType: views[currentIndex], - // )); - // } - // }, - // ); - // } - // emit(DateSelectedState()); - // } void checkDayMonthYearSelected( SelectDateEvent event, Emitter emit) async {