batch_control

This commit is contained in:
mohammad
2024-10-25 20:17:34 +03:00
parent a594d5b93c
commit 23e54c7e78

View File

@ -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 {