mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
batch_control
This commit is contained in:
@ -588,16 +588,14 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
|||||||
TextButton(
|
TextButton(
|
||||||
child: const Text('Cancel'),
|
child: const Text('Cancel'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context).pop(); // Pops without value, returning null
|
||||||
.pop(); // Pops without value, returning null
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: const Text('OK'),
|
child: const Text('OK'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final selectedDateTime = DateTime(selectedYear);
|
final selectedDateTime = DateTime(selectedYear);
|
||||||
Navigator.of(context).pop(
|
Navigator.of(context).pop(selectedDateTime); // Pops with the selected date
|
||||||
selectedDateTime); // Pops with the selected date
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -677,53 +675,6 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
|||||||
|
|
||||||
DateTime? dateTime = DateTime.now();
|
DateTime? dateTime = DateTime.now();
|
||||||
String formattedDate = DateFormat('yyyy/MM/dd').format(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(
|
void checkDayMonthYearSelected(
|
||||||
SelectDateEvent event, Emitter<SmartPowerState> emit) async {
|
SelectDateEvent event, Emitter<SmartPowerState> emit) async {
|
||||||
|
Reference in New Issue
Block a user