mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
power_clamp_issue
This commit is contained in:
@ -589,16 +589,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();
|
||||||
.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);
|
||||||
selectedDateTime); // Pops with the selected date
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -681,8 +679,6 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
|||||||
SelectDateEvent event, Emitter<SmartPowerState> emit) async {
|
SelectDateEvent event, Emitter<SmartPowerState> emit) async {
|
||||||
Future<DateTime?> Function(BuildContext context)? dateSelector;
|
Future<DateTime?> Function(BuildContext context)? dateSelector;
|
||||||
String dateFormat;
|
String dateFormat;
|
||||||
|
|
||||||
// Determine which picker to use and format to apply
|
|
||||||
switch (currentIndex) {
|
switch (currentIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
dateSelector = (context) {
|
dateSelector = (context) {
|
||||||
@ -723,7 +719,6 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
|||||||
});
|
});
|
||||||
emit(FilterRecordsState(filteredRecords: energyDataList));
|
emit(FilterRecordsState(filteredRecords: energyDataList));
|
||||||
|
|
||||||
// emit(DateSelectedState());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<EnergyData> energyDataList = [];
|
List<EnergyData> energyDataList = [];
|
||||||
@ -778,6 +773,7 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String endChartDate = '';
|
String endChartDate = '';
|
||||||
|
|
||||||
void selectDateRange() async {
|
void selectDateRange() async {
|
||||||
DateTime startDate = dateTime!;
|
DateTime startDate = dateTime!;
|
||||||
DateTime endDate = DateTime(startDate.year, startDate.month + 1, 1)
|
DateTime endDate = DateTime(startDate.year, startDate.month + 1, 1)
|
||||||
|
@ -95,7 +95,7 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 15),
|
padding: const EdgeInsets.only(top: 15),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: MediaQuery.of(context).size.height * 0.15,
|
height: MediaQuery.of(context).size.height * 0.12,
|
||||||
child: LineChart(
|
child: LineChart(
|
||||||
LineChartData(
|
LineChartData(
|
||||||
lineTouchData: LineTouchData(
|
lineTouchData: LineTouchData(
|
||||||
@ -240,20 +240,24 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
|||||||
child: Container(child: widget.widget),
|
child: Container(child: widget.widget),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
SizedBox(
|
||||||
Container(
|
width: 20,
|
||||||
padding: const EdgeInsets.all(5.0),
|
),
|
||||||
decoration: BoxDecoration(
|
Expanded(
|
||||||
color: ColorsManager.graysColor,
|
child: Container(
|
||||||
borderRadius: BorderRadius.circular(10),
|
padding: const EdgeInsets.all(5.0),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
child: InkWell(
|
color: ColorsManager.graysColor,
|
||||||
onTap: widget.onTap,
|
borderRadius: BorderRadius.circular(10),
|
||||||
child: Center(
|
),
|
||||||
child: SizedBox(
|
child: InkWell(
|
||||||
child: Padding(
|
onTap: widget.onTap,
|
||||||
padding: const EdgeInsets.all(5),
|
child: Center(
|
||||||
child: Text(widget.formattedDate),
|
child: SizedBox(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(5),
|
||||||
|
child: Text(widget.date),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -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_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/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_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/factory_reset.dart';
|
||||||
import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.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';
|
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
|
||||||
@ -45,7 +44,7 @@ class PowerClampBatchControlView extends StatelessWidget
|
|||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 170,
|
width: 170,
|
||||||
height: 140,
|
// height: 140,
|
||||||
child: FirmwareUpdateWidget(deviceId: deviceIds.first, version: 2)),
|
child: FirmwareUpdateWidget(deviceId: deviceIds.first, version: 2)),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 12,
|
width: 12,
|
||||||
|
Reference in New Issue
Block a user