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 3928fb51..52cccff4 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 @@ -33,56 +33,190 @@ class SmartPowerBloc extends Bloc { int currentPage = 0; List record = [ - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:15:43'), value: '2286'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:15:35'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:15:29'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:15:25'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:15:21'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:15:17'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:15:07'), value: '2286'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:14:47'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:14:40'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:14:23'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2024-10-23 11:14:13'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:15:43'), value: '2286'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:15:35'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:15:29'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:15:25'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:15:21'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:15:17'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:15:07'), value: '2286'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:14:47'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:14:40'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:14:23'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-10-23 11:14:13'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:15:43'), value: '2286'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:15:35'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:15:29'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:15:25'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:15:21'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:15:17'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:15:07'), value: '2286'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:14:47'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:14:40'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:14:23'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-23 11:14:13'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-11 11:15:43'), value: '2286'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-11 11:15:35'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-12 11:15:29'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-13 11:15:25'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-14 11:15:21'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-15 11:15:17'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-16 11:15:07'), value: '2286'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-17 11:14:47'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-18 11:14:40'), value: '2284'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-19 11:14:23'), value: '2285'), - EventDevice(code: 'VoltageA', eventTime: DateTime.parse('2023-02-20 11:14:13'), value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:15:43'), + value: '2286'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:15:35'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:15:29'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:15:25'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:15:21'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:15:17'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:15:07'), + value: '2286'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:14:47'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:14:40'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:14:23'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2024-10-23 11:14:13'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:15:43'), + value: '2286'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:15:35'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:15:29'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:15:25'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:15:21'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:15:17'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:15:07'), + value: '2286'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:14:47'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:14:40'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:14:23'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-10-23 11:14:13'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:15:43'), + value: '2286'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:15:35'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:15:29'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:15:25'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:15:21'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:15:17'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:15:07'), + value: '2286'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:14:47'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:14:40'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:14:23'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-23 11:14:13'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-11 11:15:43'), + value: '2286'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-11 11:15:35'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-12 11:15:29'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-13 11:15:25'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-14 11:15:21'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-15 11:15:17'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-16 11:15:07'), + value: '2286'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-17 11:14:47'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-18 11:14:40'), + value: '2284'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-19 11:14:23'), + value: '2285'), + EventDevice( + code: 'VoltageA', + eventTime: DateTime.parse('2023-02-20 11:14:13'), + value: '2284'), ]; - FutureOr _onFetchDeviceStatus(SmartPowerFetchDeviceEvent event, Emitter emit) async { + FutureOr _onFetchDeviceStatus( + SmartPowerFetchDeviceEvent event, Emitter emit) async { emit(SmartPowerLoading()); try { - var status = await DevicesManagementApi().getPowerClampInfo(event.deviceId); + var status = + await DevicesManagementApi().getPowerClampInfo(event.deviceId); deviceStatus = PowerClampModel.fromJson(status); phaseData = [ @@ -114,19 +248,22 @@ class SmartPowerBloc extends Bloc { } } - FutureOr _onArrowPressed(SmartPowerArrowPressedEvent event, Emitter emit) { + FutureOr _onArrowPressed( + SmartPowerArrowPressedEvent event, Emitter emit) { currentPage = (currentPage + event.direction + 4) % 4; emit(SmartPowerStatusLoaded(deviceStatus, currentPage)); emit(GetDeviceStatus()); } - FutureOr _onPageChanged(SmartPowerPageChangedEvent event, Emitter emit) { + FutureOr _onPageChanged( + SmartPowerPageChangedEvent event, Emitter emit) { currentPage = event.page; emit(SmartPowerStatusLoaded(deviceStatus, currentPage)); emit(GetDeviceStatus()); } - Future _onFactoryReset(SmartPowerFactoryReset event, Emitter emit) async { + Future _onFactoryReset( + SmartPowerFactoryReset event, Emitter emit) async { emit(SmartPowerLoading()); try { final response = await DevicesManagementApi().factoryReset( @@ -143,7 +280,8 @@ class SmartPowerBloc extends Bloc { } } - Future _onBatchControl(PowerBatchControlEvent event, Emitter emit) async { + Future _onBatchControl( + PowerBatchControlEvent event, Emitter emit) async { final oldValue = deviceStatus.status; _updateLocalValue(event.code, event.value); @@ -159,11 +297,14 @@ class SmartPowerBloc extends Bloc { ); } - Future _onFetchBatchStatus(SmartPowerFetchBatchEvent event, Emitter emit) async { + Future _onFetchBatchStatus( + SmartPowerFetchBatchEvent event, Emitter emit) async { emit(SmartPowerLoading()); try { - final response = await DevicesManagementApi().getPowerStatus(event.devicesIds); - PowerClampBatchModel deviceStatus = PowerClampBatchModel.fromJson(response); + final response = + await DevicesManagementApi().getPowerStatus(event.devicesIds); + PowerClampBatchModel deviceStatus = + PowerClampBatchModel.fromJson(response); emit(SmartPowerLoadBatchControll(deviceStatus)); } catch (e) { @@ -195,9 +336,11 @@ class SmartPowerBloc extends Bloc { try { late bool response; if (isBatch) { - response = await DevicesManagementApi().deviceBatchControl(deviceId, code, value); + response = await DevicesManagementApi() + .deviceBatchControl(deviceId, code, value); } else { - response = await DevicesManagementApi().deviceControl(deviceId, Status(code: code, value: value)); + response = await DevicesManagementApi() + .deviceControl(deviceId, Status(code: code, value: value)); } if (!response) { @@ -217,7 +360,8 @@ class SmartPowerBloc extends Bloc { } } - void _revertValueAndEmit(String deviceId, String code, dynamic oldValue, Emitter emit) { + void _revertValueAndEmit(String deviceId, String code, dynamic oldValue, + Emitter emit) { _updateLocalValue(code, oldValue); emit(SmartPowerLoadBatchControll(deviceBatchStatus)); } @@ -274,8 +418,10 @@ class SmartPowerBloc extends Bloc { int selectedYear = DateTime.now().year; int selectedMonth = DateTime.now().month; - FixedExtentScrollController yearController = FixedExtentScrollController(initialItem: selectedYear - 1905); - FixedExtentScrollController monthController = FixedExtentScrollController(initialItem: selectedMonth - 1); + FixedExtentScrollController yearController = + FixedExtentScrollController(initialItem: selectedYear - 1905); + FixedExtentScrollController monthController = + FixedExtentScrollController(initialItem: selectedMonth - 1); return await showDialog( context: context, @@ -285,7 +431,10 @@ class SmartPowerBloc extends Bloc { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - color: Colors.white, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + ), height: 350, width: 350, child: Column( @@ -294,7 +443,8 @@ class SmartPowerBloc extends Bloc { padding: EdgeInsets.all(16.0), child: Text( 'Select Month and Year', - style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + style: + TextStyle(fontSize: 20, fontWeight: FontWeight.bold), ), ), const Divider(), @@ -337,7 +487,8 @@ class SmartPowerBloc extends Bloc { builder: (context, index) { return Center( child: Text( - DateFormat.MMMM().format(DateTime(0, index + 1)), + DateFormat.MMMM() + .format(DateTime(0, index + 1)), style: const TextStyle(fontSize: 18), ), ); @@ -352,7 +503,8 @@ class SmartPowerBloc extends Bloc { ), const Divider(), Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + padding: const EdgeInsets.symmetric( + horizontal: 16.0, vertical: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -365,7 +517,8 @@ class SmartPowerBloc extends Bloc { TextButton( child: const Text('OK'), onPressed: () { - final selectedDateTime = DateTime(selectedYear, selectedMonth); + final selectedDateTime = + DateTime(selectedYear, selectedMonth); Navigator.of(context).pop(selectedDateTime); }, ), @@ -383,7 +536,8 @@ class SmartPowerBloc extends Bloc { Future selectYear(BuildContext context) async { int selectedYear = DateTime.now().year; - FixedExtentScrollController yearController = FixedExtentScrollController(initialItem: selectedYear - 1905); + FixedExtentScrollController yearController = + FixedExtentScrollController(initialItem: selectedYear - 1905); return await showDialog( context: context, @@ -393,7 +547,10 @@ class SmartPowerBloc extends Bloc { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - color: Colors.white, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + ), height: 350, width: 350, child: Column( @@ -402,7 +559,8 @@ class SmartPowerBloc extends Bloc { padding: EdgeInsets.all(16.0), child: Text( 'Select Year', - style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + style: + TextStyle(fontSize: 20, fontWeight: FontWeight.bold), ), ), const Divider(), @@ -429,7 +587,8 @@ class SmartPowerBloc extends Bloc { ), const Divider(), Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + padding: const EdgeInsets.symmetric( + horizontal: 16.0, vertical: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -492,7 +651,8 @@ class SmartPowerBloc extends Bloc { ), const Divider(), Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + padding: const EdgeInsets.symmetric( + horizontal: 16.0, vertical: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -524,7 +684,8 @@ class SmartPowerBloc extends Bloc { String formattedDate = DateFormat('yyyy/MM/dd').format(DateTime.now()); - void checkDayMonthYearSelected(SelectDateEvent event, Emitter emit) async { + void checkDayMonthYearSelected( + SelectDateEvent event, Emitter emit) async { Future Function(BuildContext context)? dateSelector; String dateFormat; switch (currentIndex) { @@ -569,18 +730,23 @@ class SmartPowerBloc extends Bloc { } List energyDataList = []; - void _filterRecordsByDate(FilterRecordsByDateEvent event, Emitter emit) { + void _filterRecordsByDate( + FilterRecordsByDateEvent event, Emitter emit) { // emit(SmartPowerLoading()); if (event.viewType == 'Year') { formattedDate = event.selectedDate.year.toString(); - filteredRecords = record.where((record) => record.eventTime!.year == event.selectedDate.year).toList(); + filteredRecords = record + .where((record) => record.eventTime!.year == event.selectedDate.year) + .toList(); } else if (event.viewType == 'Month') { - formattedDate = "${event.selectedDate.year.toString()}-${getMonthShortName(event.selectedDate.month)}"; + formattedDate = + "${event.selectedDate.year.toString()}-${getMonthShortName(event.selectedDate.month)}"; filteredRecords = record .where((record) => - record.eventTime!.year == event.selectedDate.year && record.eventTime!.month == event.selectedDate.month) + record.eventTime!.year == event.selectedDate.year && + record.eventTime!.month == event.selectedDate.month) .toList(); } else if (event.viewType == 'Day') { formattedDate = @@ -598,7 +764,8 @@ class SmartPowerBloc extends Bloc { energyDataList = filteredRecords.map((eventDevice) { return EnergyData( event.viewType == 'Year' - ? getMonthShortName(int.tryParse(DateFormat('MM').format(eventDevice.eventTime!))!) + ? getMonthShortName( + int.tryParse(DateFormat('MM').format(eventDevice.eventTime!))!) : event.viewType == 'Month' ? DateFormat('yyyy/MM/dd').format(eventDevice.eventTime!) : DateFormat('HH:mm:ss').format(eventDevice.eventTime!), @@ -617,7 +784,8 @@ class SmartPowerBloc extends Bloc { void selectDateRange() async { DateTime startDate = dateTime!; - DateTime endDate = DateTime(startDate.year, startDate.month + 1, 1).subtract(Duration(days: 1)); + DateTime endDate = DateTime(startDate.year, startDate.month + 1, 1) + .subtract(Duration(days: 1)); String formattedEndDate = DateFormat('dd/MM/yyyy').format(endDate); endChartDate = ' - $formattedEndDate'; } diff --git a/lib/pages/device_managment/power_clamp/view/power_chart.dart b/lib/pages/device_managment/power_clamp/view/power_chart.dart index 273537ba..19050b8a 100644 --- a/lib/pages/device_managment/power_clamp/view/power_chart.dart +++ b/lib/pages/device_managment/power_clamp/view/power_chart.dart @@ -93,9 +93,9 @@ class _EnergyConsumptionPageState extends State { Column( children: [ Padding( - padding: const EdgeInsets.only(top: 15), + padding: const EdgeInsets.only(top: 10), child: SizedBox( - height: MediaQuery.of(context).size.height * 0.12, + height: MediaQuery.of(context).size.height * 0.11, child: LineChart( LineChartData( lineTouchData: LineTouchData( @@ -227,7 +227,7 @@ class _EnergyConsumptionPageState extends State { ), ), Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.all(5.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -240,7 +240,7 @@ class _EnergyConsumptionPageState extends State { child: Container(child: widget.widget), ), ), - SizedBox( + const SizedBox( width: 20, ), Expanded( diff --git a/lib/pages/device_managment/power_clamp/view/smart_power_device_control.dart b/lib/pages/device_managment/power_clamp/view/smart_power_device_control.dart index 2b16946f..03d649fa 100644 --- a/lib/pages/device_managment/power_clamp/view/smart_power_device_control.dart +++ b/lib/pages/device_managment/power_clamp/view/smart_power_device_control.dart @@ -172,9 +172,10 @@ class SmartPowerDeviceControl extends StatelessWidget ), ), const SizedBox( - height: 10, + height: 5, ), Expanded( + flex: 2, child: PageView( controller: _pageController, onPageChanged: (int page) { @@ -184,7 +185,7 @@ class SmartPowerDeviceControl extends StatelessWidget children: [ EnergyConsumptionPage( formattedDate: - '${blocProvider.formattedDate}${blocProvider.endChartDate}', + '${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}', onTap: () { blocProvider.add(SelectDateEvent(context: context)); blocProvider.add(FilterRecordsByDateEvent( @@ -213,7 +214,8 @@ class SmartPowerDeviceControl extends StatelessWidget date: blocProvider.formattedDate, ), EnergyConsumptionPage( - formattedDate: blocProvider.formattedDate, + formattedDate: + '${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}', onTap: () { blocProvider.add(SelectDateEvent(context: context)); }, @@ -238,7 +240,8 @@ class SmartPowerDeviceControl extends StatelessWidget date: blocProvider.formattedDate, ), EnergyConsumptionPage( - formattedDate: blocProvider.formattedDate, + formattedDate: + '${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}', onTap: () { blocProvider.add(SelectDateEvent(context: context)); },