mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-27 20:24:56 +00:00
Fixed thrown exceptions because of Expanded widgets.
This commit is contained in:
@ -72,55 +72,54 @@ class AqiDeviceInfo extends StatelessWidget {
|
|||||||
return Container(
|
return Container(
|
||||||
decoration: secondarySection.copyWith(boxShadow: const []),
|
decoration: secondarySection.copyWith(boxShadow: const []),
|
||||||
padding: const EdgeInsetsDirectional.all(20),
|
padding: const EdgeInsetsDirectional.all(20),
|
||||||
child: Expanded(
|
child: Column(
|
||||||
child: Column(
|
spacing: 6,
|
||||||
spacing: 6,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
const AirQualityEndSideLiveIndicator(),
|
const AirQualityEndSideLiveIndicator(),
|
||||||
AirQualityEndSideGaugeAndInfo(
|
AirQualityEndSideGaugeAndInfo(
|
||||||
aqiLevel: status
|
aqiLevel: status
|
||||||
.firstWhere(
|
.firstWhere(
|
||||||
(e) => e.code == 'air_quality_index',
|
(e) => e.code == 'air_quality_index',
|
||||||
orElse: () => Status(code: 'air_quality_index', value: ''),
|
orElse: () => Status(code: 'air_quality_index', value: ''),
|
||||||
)
|
)
|
||||||
.value
|
.value
|
||||||
.toString(),
|
.toString(),
|
||||||
temperature: int.parse(tempValue),
|
temperature: int.parse(tempValue),
|
||||||
humidity: int.parse(humidityValue),
|
humidity: int.parse(humidityValue),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
AqiSubValueWidget(
|
AqiSubValueWidget(
|
||||||
range: (0, 999),
|
range: (0, 999),
|
||||||
label: AqiType.pm25.value,
|
label: AqiType.pm25.value,
|
||||||
value: pm25Value,
|
value: pm25Value,
|
||||||
unit: AqiType.pm25.unit,
|
unit: AqiType.pm25.unit,
|
||||||
),
|
),
|
||||||
AqiSubValueWidget(
|
AqiSubValueWidget(
|
||||||
range: (0, 999),
|
range: (0, 999),
|
||||||
label: AqiType.pm10.value,
|
label: AqiType.pm10.value,
|
||||||
value: pm10Value,
|
value: pm10Value,
|
||||||
unit: AqiType.pm10.unit,
|
unit: AqiType.pm10.unit,
|
||||||
),
|
),
|
||||||
AqiSubValueWidget(
|
AqiSubValueWidget(
|
||||||
range: (0, 5),
|
range: (0, 5),
|
||||||
label: AqiType.hcho.value,
|
label: AqiType.hcho.value,
|
||||||
value: ch2oValue,
|
value: ch2oValue,
|
||||||
unit: AqiType.hcho.unit,
|
unit: AqiType.hcho.unit,
|
||||||
),
|
),
|
||||||
AqiSubValueWidget(
|
AqiSubValueWidget(
|
||||||
range: (0, 999),
|
range: (0, 999),
|
||||||
label: AqiType.tvoc.value,
|
label: AqiType.tvoc.value,
|
||||||
value: tvocValue,
|
value: tvocValue,
|
||||||
unit: AqiType.tvoc.unit,
|
unit: AqiType.tvoc.unit,
|
||||||
),
|
),
|
||||||
AqiSubValueWidget(
|
AqiSubValueWidget(
|
||||||
range: (0, 5000),
|
range: (0, 5000),
|
||||||
label: AqiType.co2.value,
|
label: AqiType.co2.value,
|
||||||
value: co2Value,
|
value: co2Value,
|
||||||
unit: AqiType.co2.unit,
|
unit: AqiType.co2.unit,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -18,24 +18,24 @@ class AqiLocationInfo extends StatelessWidget {
|
|||||||
AqiLocation(),
|
AqiLocation(),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
AqiLocationInfoCell(
|
AqiLocationInfoCell(
|
||||||
label: 'Temperature',
|
label: 'Temperature',
|
||||||
value: ' 25°',
|
value: ' 25°',
|
||||||
svgPath: Assets.aqiTemperature,
|
svgPath: Assets.aqiTemperature,
|
||||||
),
|
),
|
||||||
AqiLocationInfoCell(
|
AqiLocationInfoCell(
|
||||||
label: 'Humidity',
|
label: 'Humidity',
|
||||||
value: '25%',
|
value: '25%',
|
||||||
svgPath: Assets.aqiHumidity,
|
svgPath: Assets.aqiHumidity,
|
||||||
),
|
),
|
||||||
AqiLocationInfoCell(
|
AqiLocationInfoCell(
|
||||||
label: 'Air Quality',
|
label: 'Air Quality',
|
||||||
value: ' 120',
|
value: ' 120',
|
||||||
svgPath: Assets.aqiAirQuality,
|
svgPath: Assets.aqiAirQuality,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user