power_clamp_issue

This commit is contained in:
mohammad
2024-10-29 09:43:09 +03:00
parent 62e8c372f7
commit 81913dca9f
3 changed files with 23 additions and 24 deletions

View File

@ -589,16 +589,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();
},
),
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);
},
),
],
@ -681,8 +679,6 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
SelectDateEvent event, Emitter<SmartPowerState> emit) async {
Future<DateTime?> Function(BuildContext context)? dateSelector;
String dateFormat;
// Determine which picker to use and format to apply
switch (currentIndex) {
case 0:
dateSelector = (context) {
@ -723,7 +719,6 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
});
emit(FilterRecordsState(filteredRecords: energyDataList));
// emit(DateSelectedState());
}
List<EnergyData> energyDataList = [];
@ -778,6 +773,7 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
}
String endChartDate = '';
void selectDateRange() async {
DateTime startDate = dateTime!;
DateTime endDate = DateTime(startDate.year, startDate.month + 1, 1)

View File

@ -95,7 +95,7 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
Padding(
padding: const EdgeInsets.only(top: 15),
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.15,
height: MediaQuery.of(context).size.height * 0.12,
child: LineChart(
LineChartData(
lineTouchData: LineTouchData(
@ -240,20 +240,24 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
child: Container(child: widget.widget),
),
),
const Spacer(),
Container(
padding: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
color: ColorsManager.graysColor,
borderRadius: BorderRadius.circular(10),
),
child: InkWell(
onTap: widget.onTap,
child: Center(
child: SizedBox(
child: Padding(
padding: const EdgeInsets.all(5),
child: Text(widget.formattedDate),
SizedBox(
width: 20,
),
Expanded(
child: Container(
padding: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
color: ColorsManager.graysColor,
borderRadius: BorderRadius.circular(10),
),
child: InkWell(
onTap: widget.onTap,
child: Center(
child: SizedBox(
child: Padding(
padding: const EdgeInsets.all(5),
child: Text(widget.date),
),
),
),
),

View File

@ -5,7 +5,6 @@ import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_event.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_state.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/models/power_clamp_batch_model.dart';
import 'package:syncrow_web/pages/device_managment/power_clamp/models/power_clamp_model.dart';
import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart';
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
@ -45,7 +44,7 @@ class PowerClampBatchControlView extends StatelessWidget
children: [
SizedBox(
width: 170,
height: 140,
// height: 140,
child: FirmwareUpdateWidget(deviceId: deviceIds.first, version: 2)),
const SizedBox(
width: 12,