mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
batch_control
This commit is contained in:
@ -260,7 +260,7 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
currentPage = event.page;
|
||||
emit(SmartPowerStatusLoaded(deviceStatus, currentPage));
|
||||
}
|
||||
|
||||
|
||||
Future<void> _onFactoryReset(
|
||||
SmartPowerFactoryReset event, Emitter<SmartPowerState> emit) async {
|
||||
emit(SmartPowerLoading());
|
||||
@ -588,16 +588,14 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
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<SmartPowerEvent, SmartPowerState> {
|
||||
|
||||
DateTime? dateTime = DateTime.now();
|
||||
String formattedDate = DateFormat('yyyy/MM/dd').format(DateTime.now());
|
||||
// void checkDayMonthYearSelected(
|
||||
// SelectDateEvent event, Emitter<SmartPowerState> 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<SmartPowerState> emit) async {
|
||||
|
Reference in New Issue
Block a user