更新分享
This commit is contained in:
477
lib/pages/device/device_detail.dart
Normal file
477
lib/pages/device/device_detail.dart
Normal file
@@ -0,0 +1,477 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
|
||||
import 'package:vbvs_app/controller/device/device_type_controller.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
|
||||
class DeviceDetailPage extends StatefulWidget {
|
||||
var device;
|
||||
DeviceDetailPage({super.key, required this.device});
|
||||
|
||||
@override
|
||||
State<DeviceDetailPage> createState() => _DeviceDetailPageState();
|
||||
}
|
||||
|
||||
class _DeviceDetailPageState extends State<DeviceDetailPage> {
|
||||
GlobalController globalController = Get.find();
|
||||
UserInfoController userInfoController = Get.find();
|
||||
BlueteethBindController blueteethBindController = Get.find();
|
||||
ThemeController themeController = Get.find();
|
||||
DeviceTypeController deviceTypeController = Get.find();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/img/bgNoImg.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent, // 加上这一行
|
||||
appBar: AppBar(
|
||||
backgroundColor: themeController.currentColor.sc17,
|
||||
// backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: themeController.currentColor.sc3),
|
||||
titleSpacing: 0.rpx,
|
||||
// leading: returnIconButtom,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
/// 居中标题
|
||||
Text(
|
||||
'设备详情.标题'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0.rpx,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
Positioned(
|
||||
left: 0.rpx,
|
||||
child: returnIconButtom,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 26.rpx, 30.rpx, 0.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
50.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.267,
|
||||
height: MediaQuery.sizeOf(context).width * 0.267,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 200.rpx,
|
||||
minHeight: 200.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'设备详情.设备名称'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'设备详情.MAC'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'设备详情.型号'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'设备详情.版本'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'设备详情.网络状态'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'设备详情.故障状态'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'设备详情.更新状态'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'设备详情.更新时间'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(height: 34.rpx))
|
||||
.addToStart(SizedBox(height: 92.rpx))
|
||||
.addToEnd(SizedBox(height: 97.rpx)),
|
||||
),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.267,
|
||||
height: MediaQuery.sizeOf(context).width * 0.267,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 200.rpx,
|
||||
minHeight: 200.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.secondaryBackground,
|
||||
),
|
||||
// child: ClipRRect(
|
||||
// borderRadius: BorderRadius.circular(8.rpx),
|
||||
// child: Image.network(
|
||||
// 'https://picsum.photos/seed/851/600',
|
||||
// width: 200.rpx,
|
||||
// height: 200.rpx,
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
child: QrImageView(
|
||||
data: '1234567890',
|
||||
version: QrVersions.auto,
|
||||
size: 200.0.rpx,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'A35968956',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'${widget.device['person']['name'] ?? '未命名'.tr}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'${widget.device['mac'] ?? '-'.tr}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'-',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'-',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'${widget.device['status']['status'] == 1 ? '在线'.tr : '离线'.tr}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'${widget.device['status']['failure'] == 1 ? '有故障'.tr : '无故障'.tr}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'${widget.device['status']['upgrade'] == 1 ? '有更新'.tr : '无更新'.tr}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'${widget.device['update_time'] ?? '-'.tr}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(height: 34.rpx))
|
||||
.addToStart(SizedBox(height: 92.rpx))
|
||||
.addToEnd(SizedBox(height: 97.rpx)),
|
||||
),
|
||||
].divide(SizedBox(width: 34.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user