路径规划和设备详情界面信息展示
This commit is contained in:
@@ -117,13 +117,13 @@ class _WorkParamsCardState extends State<WorkParamsCard> {
|
||||
final result = await useCase(params);
|
||||
print("发送获取历史作业记录结束");
|
||||
result.fold(
|
||||
(failure) {
|
||||
(failure) {
|
||||
setState(() {
|
||||
_errorMessage = failure.message;
|
||||
_isLoading = false;
|
||||
});
|
||||
},
|
||||
(data) {
|
||||
(data) {
|
||||
setState(() {
|
||||
_statistics = data;
|
||||
_isLoading = false;
|
||||
@@ -141,9 +141,12 @@ class _WorkParamsCardState extends State<WorkParamsCard> {
|
||||
}
|
||||
|
||||
// 弹窗展示详情
|
||||
// 弹窗展示详情(从底部弹出)
|
||||
// 弹窗展示详情(从底部弹出,覆盖底部导航栏)
|
||||
void _showDetailsDialog(BuildContext context, List<DeviceRunStatisticsEntity> data) {
|
||||
// 弹窗展示详情(从底部弹出)
|
||||
// 弹窗展示详情(从底部弹出,覆盖底部导航栏)
|
||||
void _showDetailsDialog(
|
||||
BuildContext context,
|
||||
List<DeviceRunStatisticsEntity> data,
|
||||
) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true, // 支持全屏高度
|
||||
@@ -203,15 +206,31 @@ class _WorkParamsCardState extends State<WorkParamsCard> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildDetailRow(Icons.calendar_today, '开始时间', item.startTime),
|
||||
_buildDetailRow(Icons.calendar_today_outlined, '结束时间', item.endTime),
|
||||
_buildDetailRow(Icons.square_foot, '工作面积', '${item.workArea} 亩'),
|
||||
_buildDetailRow(
|
||||
Icons.calendar_today,
|
||||
'开始时间',
|
||||
item.startTime,
|
||||
),
|
||||
_buildDetailRow(
|
||||
Icons.calendar_today_outlined,
|
||||
'结束时间',
|
||||
item.endTime,
|
||||
),
|
||||
_buildDetailRow(
|
||||
Icons.square_foot,
|
||||
'工作面积',
|
||||
'${item.workArea} 亩',
|
||||
),
|
||||
_buildDetailRow(
|
||||
Icons.directions_car,
|
||||
'工作距离',
|
||||
'${item.distance?.toStringAsFixed(2) ?? '未计算'} km',
|
||||
),
|
||||
_buildDetailRow(Icons.timer, '花费时间', '${item.time} 小时'),
|
||||
_buildDetailRow(
|
||||
Icons.timer,
|
||||
'花费时间',
|
||||
'${item.time} 小时',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -244,9 +263,7 @@ class _WorkParamsCardState extends State<WorkParamsCard> {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 构建详情行
|
||||
// 构建详情行
|
||||
Widget _buildDetailRow(IconData icon, String label, String value) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
@@ -265,10 +282,7 @@ class _WorkParamsCardState extends State<WorkParamsCard> {
|
||||
Expanded(
|
||||
child: Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.black54,
|
||||
),
|
||||
style: const TextStyle(fontSize: 14, color: Colors.black54),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -276,9 +290,6 @@ class _WorkParamsCardState extends State<WorkParamsCard> {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 构建单个参数项
|
||||
Widget _buildParamItem(String label, String value, String unit) {
|
||||
return Expanded(
|
||||
|
||||
Reference in New Issue
Block a user