diff --git a/.github/workflows/azure-static-web-apps-zealous-mushroom-0d31a3303.yml b/.github/workflows/azure-static-web-apps-zealous-mushroom-0d31a3303.yml index b8d576b9..a154206e 100644 --- a/.github/workflows/azure-static-web-apps-zealous-mushroom-0d31a3303.yml +++ b/.github/workflows/azure-static-web-apps-zealous-mushroom-0d31a3303.yml @@ -31,7 +31,7 @@ jobs: run: flutter pub get - name: Build Flutter Web App - run: flutter build web + run: flutter build web --release --dart-define=FLAVOR=development - name: Build And Deploy id: builddeploy diff --git a/lib/pages/device_managment/shared/table/report_table.dart b/lib/pages/device_managment/shared/table/report_table.dart index ef189f3a..d655964b 100644 --- a/lib/pages/device_managment/shared/table/report_table.dart +++ b/lib/pages/device_managment/shared/table/report_table.dart @@ -58,7 +58,7 @@ class ReportsTable extends StatelessWidget { TableCellWidget(value: date), TableCellWidget(value: time), TableCellWidget( - value: '${data.value!} $thirdColumnDescription', + value: '${data.value!} ${thirdColumnDescription ?? ''}', onTap: () => onRowTap(index), ), ], diff --git a/lib/pages/device_managment/wall_sensor/bloc/bloc.dart b/lib/pages/device_managment/wall_sensor/bloc/bloc.dart index a2697cd3..bda4d968 100644 --- a/lib/pages/device_managment/wall_sensor/bloc/bloc.dart +++ b/lib/pages/device_managment/wall_sensor/bloc/bloc.dart @@ -99,7 +99,7 @@ class WallSensorBloc extends Bloc { try { await DevicesManagementApi.getDeviceReports(deviceId, event.code) .then((value) { - emit(DeviceReportsState(deviceReport: value)); + emit(DeviceReportsState(deviceReport: value, code:event.code)); }); } catch (e) { emit(DeviceReportsFailedState(error: e.toString())); diff --git a/lib/pages/device_managment/wall_sensor/bloc/state.dart b/lib/pages/device_managment/wall_sensor/bloc/state.dart index 67ce0d19..19a154a9 100644 --- a/lib/pages/device_managment/wall_sensor/bloc/state.dart +++ b/lib/pages/device_managment/wall_sensor/bloc/state.dart @@ -42,7 +42,8 @@ class DeviceReportsLoadingState extends WallSensorState {} class DeviceReportsState extends WallSensorState { final DeviceReport deviceReport; - const DeviceReportsState({required this.deviceReport}); + final String code; + const DeviceReportsState({required this.deviceReport, required this.code}); } class DeviceReportsFailedState extends WallSensorState { diff --git a/lib/pages/device_managment/wall_sensor/view/wall_sensor_conrtols.dart b/lib/pages/device_managment/wall_sensor/view/wall_sensor_conrtols.dart index 8448ef67..fce90593 100644 --- a/lib/pages/device_managment/wall_sensor/view/wall_sensor_conrtols.dart +++ b/lib/pages/device_managment/wall_sensor/view/wall_sensor_conrtols.dart @@ -38,8 +38,10 @@ class WallSensorControls extends StatelessWidget with HelperResponsiveLayout { } else if (state is DeviceReportsState) { return ReportsTable( report: state.deviceReport, - thirdColumnTitle: "Value", - thirdColumnDescription: "Lux", + thirdColumnTitle: + state.code == 'illuminance_value' ? "Value" : 'Status', + thirdColumnDescription: + state.code == 'illuminance_value' ? "Lux" : null, onRowTap: (index) {}, onClose: () { context.read().add(BackToGridViewEvent());