Merge pull request #14 from SyncrowIOT/dev

Dev
This commit is contained in:
Abdullah
2024-09-03 15:17:59 +03:00
committed by GitHub
5 changed files with 9 additions and 6 deletions

View File

@ -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

View File

@ -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),
),
],

View File

@ -99,7 +99,7 @@ class WallSensorBloc extends Bloc<WallSensorEvent, WallSensorState> {
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()));

View File

@ -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 {

View File

@ -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<WallSensorBloc>().add(BackToGridViewEvent());