更新
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.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/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/routers/routers.dart';
|
||||
|
||||
class RepairHistoryInfoWidget extends StatefulWidget {
|
||||
const RepairHistoryInfoWidget({super.key});
|
||||
var data;
|
||||
RepairHistoryInfoWidget({super.key, required this.data});
|
||||
|
||||
@override
|
||||
State<RepairHistoryInfoWidget> createState() =>
|
||||
@@ -29,226 +29,283 @@ class _RepairHistoryInfoWidgetState extends State<RepairHistoryInfoWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ClickableContainer(
|
||||
borderRadius: AppConstants().normal_container_radius,
|
||||
onTap: () {
|
||||
//跳转详情
|
||||
},
|
||||
// colors: [
|
||||
// themeController.currentColor.sc5,
|
||||
// ],
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: themeController.currentColor.sc21,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.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(30.rpx, 36.rpx, 0.rpx, 36.rpx),
|
||||
return Stack(
|
||||
children: [
|
||||
ClickableContainer(
|
||||
borderRadius: AppConstants().normal_container_radius,
|
||||
onTap: () {
|
||||
//跳转详情
|
||||
},
|
||||
// colors: [
|
||||
// themeController.currentColor.sc5,
|
||||
// ],
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: themeController.currentColor.sc21,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 130.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备类型'.tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConstants().normal_container_radius),
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(30.rpx, 36.rpx, 0.rpx, 36.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.17,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 140.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备类型'.tr,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'智能床',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).bodyMedium.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 130.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备ID'.tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
Text(
|
||||
'${widget.data['type']}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
Text(
|
||||
'15561651',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).bodyMedium.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 130.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'联系人'.tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.17,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 140.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备ID'.tr,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'王明',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).bodyMedium.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 130.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'发生时间'.tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${getDeviceInfo(widget.data)}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
Text(
|
||||
'2022-08-01 15:05',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).bodyMedium.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.17,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 140.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'联系人'.tr,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${widget.data['contacts']?['name']}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.17,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: 140.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'发生时间'.tr,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${MyUtils.timestampToDateString(widget.data['create_time'])}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.fontStyle,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 33.rpx)),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 40.rpx,
|
||||
right: 20.rpx,
|
||||
child: Container(
|
||||
width: 123.rpx,
|
||||
height: 47.rpx,
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius, // 直角
|
||||
colors: [
|
||||
themeController.currentColor.sc4.withOpacity(0.3),
|
||||
],
|
||||
enableAnimation: true, // 有点击缩放动画
|
||||
enableGradient: false, // 不用渐变
|
||||
onTap: () {
|
||||
Get.toNamed("/repairDetailPage", arguments: widget.data);
|
||||
},
|
||||
child: Center(
|
||||
child: Text(
|
||||
"查看".tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
String getDeviceInfo(Map data) {
|
||||
if (data['device'] == null || data['device'] is! List) {
|
||||
return '';
|
||||
}
|
||||
|
||||
List deviceList = data['device'];
|
||||
List<String> result = deviceList.map((device) {
|
||||
final name = device['name'] ?? '';
|
||||
final code = device['code'];
|
||||
final mac = device['mac'] ?? '';
|
||||
final suffix = (code != null && code.toString().isNotEmpty) ? code : mac;
|
||||
return '$name($suffix)';
|
||||
}).toList();
|
||||
|
||||
return result.join(', ');
|
||||
}
|
||||
}
|
||||
|
||||
489
lib/pages/repair/component/RepairModelReadOnlyWidget.dart
Normal file
489
lib/pages/repair/component/RepairModelReadOnlyWidget.dart
Normal file
@@ -0,0 +1,489 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/device/body_device_controller.dart';
|
||||
import 'package:vbvs_app/controller/repair/repair_controller.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
|
||||
class RepairModelReadOnlyWidget extends StatefulWidget {
|
||||
var model;
|
||||
final VoidCallback onTap; // 添加回调函数
|
||||
int length;
|
||||
final GlobalKey widgetKey; // 新增
|
||||
final bool showDelete; // ✅ 新增
|
||||
|
||||
RepairModelReadOnlyWidget({
|
||||
super.key,
|
||||
required this.model,
|
||||
required this.onTap,
|
||||
required this.length,
|
||||
required this.widgetKey,
|
||||
this.showDelete = true, // ✅ 默认为 false
|
||||
});
|
||||
|
||||
@override
|
||||
State<RepairModelReadOnlyWidget> createState() =>
|
||||
_RepairModelReadOnlyWidgetState();
|
||||
}
|
||||
|
||||
class _RepairModelReadOnlyWidgetState extends State<RepairModelReadOnlyWidget> {
|
||||
FormFieldController<String> _deviceController =
|
||||
FormFieldController<String>(null);
|
||||
RepairController repairController = Get.find();
|
||||
UserInfoController userInfoController = Get.find();
|
||||
late FormFieldController<String?>? _issueController;
|
||||
BodyDeviceController bodyDeviceController = Get.find();
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_issueController =
|
||||
FormFieldController<String?>(widget.model['issue'] ?? '');
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
key: widget.widgetKey, // 使用传入的 key
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConstants().normal_container_radius),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 35.rpx, 30.rpx, 35.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: 110.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备ID'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
return Expanded(
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.rpx),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: TextFormField(
|
||||
readOnly: true,
|
||||
controller: repairController.onReDraw(
|
||||
TextEditingController(text: widget.model['id']),
|
||||
(textEditingController) {
|
||||
textEditingController.text = widget.model['id'];
|
||||
}),
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.fontStyle,
|
||||
),
|
||||
hintText: "设备参数提示".tr,
|
||||
hintStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0x00000000),
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: themeController.currentColor.sc15,
|
||||
),
|
||||
style: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
cursorColor: themeController.currentColor.sc4,
|
||||
onChanged: (value) {
|
||||
widget.model['id'] = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
].divide(SizedBox(width: 24.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: 110.rpx,
|
||||
decoration: BoxDecoration(),
|
||||
child: Text(
|
||||
'设备参数'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
return Expanded(
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.rpx),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: TextFormField(
|
||||
readOnly: true,
|
||||
controller: repairController.onReDraw(
|
||||
TextEditingController(
|
||||
text: widget.model['param']),
|
||||
(textEditingController) {
|
||||
textEditingController.text =
|
||||
widget.model['param'];
|
||||
}),
|
||||
// initialValue: widget.model['param'],
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.fontStyle,
|
||||
),
|
||||
hintText: "设备参数提示".tr,
|
||||
hintStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0x00000000),
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: themeController.currentColor.sc15,
|
||||
),
|
||||
style: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
cursorColor: themeController.currentColor.sc4,
|
||||
onChanged: (value) {
|
||||
widget.model['param'] = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
].divide(SizedBox(width: 24.rpx)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 151.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc15,
|
||||
borderRadius: BorderRadius.circular(20.rpx),
|
||||
),
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
child: TextFormField(
|
||||
readOnly: true,
|
||||
controller: repairController.onReDraw(
|
||||
TextEditingController(text: widget.model['issue']),
|
||||
(textEditingController) {
|
||||
textEditingController.text = widget.model['issue'];
|
||||
}),
|
||||
onChanged: (value) {
|
||||
widget.model['issue'] = value;
|
||||
},
|
||||
maxLines: null, // 👈 支持无限行
|
||||
// controller: TextEditingController(),
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
fontWeight:
|
||||
FlutterFlowTheme.of(context).labelMedium.fontWeight,
|
||||
fontStyle:
|
||||
FlutterFlowTheme.of(context).labelMedium.fontStyle,
|
||||
),
|
||||
hintText: '问题描述'.tr,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0x00000000),
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0x00000000),
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
filled: false,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 20.rpx, horizontal: 20.rpx),
|
||||
),
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc4,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
cursorColor: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor: themeController.currentColor.sc15,
|
||||
highlightColor: themeController.currentColor.sc21,
|
||||
borderRadius: 20.rpx,
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () async {
|
||||
ApiResponse apiResponse = await repairController.uploadImg();
|
||||
print(apiResponse);
|
||||
if (apiResponse.code == HttpStatusCodes.ok) {
|
||||
print(widget.model);
|
||||
// setState(() {
|
||||
// widget.model['path'] = apiResponse.data['path'];
|
||||
// });
|
||||
widget.model['path'] = apiResponse.data['path'];
|
||||
repairController.repairList
|
||||
.refresh(); // 通知 Obx 更新(如果用了 GetX)
|
||||
print(widget.model);
|
||||
} else {
|
||||
if (widget.model['path'] == null ||
|
||||
widget.model['path'].isEmpty) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: apiResponse.msg!,
|
||||
textColor: apiResponse.code == HttpStatusCodes.ok
|
||||
? themeController.currentColor.sc2
|
||||
: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
height: MediaQuery.sizeOf(context).height * 0.203,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 151.rpx,
|
||||
),
|
||||
child: Obx(() {
|
||||
var list = repairController.repairList;
|
||||
print(list);
|
||||
if (widget.model['path'] == null ||
|
||||
widget.model['path'] == "") {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 60.rpx,
|
||||
height: 53.rpx,
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/camera.svg',
|
||||
width: 24.rpx,
|
||||
height: 24.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'上传提示'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 28.rpx)),
|
||||
);
|
||||
}
|
||||
return Container(
|
||||
// clipBehavior: Clip.antiAlias,
|
||||
child: Image.network(
|
||||
widget.model['path'],
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
);
|
||||
})),
|
||||
),
|
||||
),
|
||||
if (widget.length > 1 && widget.showDelete == true)
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
100.rpx, 0.rpx, 100.rpx, 0.rpx),
|
||||
child: CustomCard(
|
||||
borderRadius:
|
||||
AppConstants().button_container_radius, // 圆角半径
|
||||
onTap: widget.onTap,
|
||||
colors: [
|
||||
Colors.transparent,
|
||||
],
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().button_container_radius),
|
||||
),
|
||||
width: MediaQuery.sizeOf(context).width * 0.216,
|
||||
height: MediaQuery.sizeOf(context).height * 0.038,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 62.rpx,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'删除'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController.currentColor.sc9,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(
|
||||
width: 17.rpx,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 29.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,26 +5,30 @@ import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/base/THFlutterFlowDropDown.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/device/body_device_controller.dart';
|
||||
import 'package:vbvs_app/controller/repair/repair_controller.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
import 'package:vbvs_app/routers/routers.dart';
|
||||
|
||||
class RepairModelWidget extends StatefulWidget {
|
||||
var model;
|
||||
final VoidCallback onTap; // 添加回调函数
|
||||
int length;
|
||||
final GlobalKey widgetKey; // 新增
|
||||
final bool showDelete; // ✅ 新增
|
||||
|
||||
RepairModelWidget({
|
||||
super.key,
|
||||
required this.model,
|
||||
required this.onTap,
|
||||
required this.length,
|
||||
required this.widgetKey,
|
||||
this.showDelete = true, // ✅ 默认为 false
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -36,6 +40,8 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
FormFieldController<String>(null);
|
||||
RepairController repairController = Get.find();
|
||||
UserInfoController userInfoController = Get.find();
|
||||
late FormFieldController<String?>? _issueController;
|
||||
BodyDeviceController bodyDeviceController = Get.find();
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
@@ -45,6 +51,8 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_issueController =
|
||||
FormFieldController<String?>(widget.model['issue'] ?? '');
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -54,7 +62,6 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// _deviceController.value = "";
|
||||
return Container(
|
||||
key: widget.widgetKey, // 使用传入的 key
|
||||
width: double.infinity,
|
||||
@@ -97,8 +104,31 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
),
|
||||
height: AppConstants().dropdown_height,
|
||||
child: THFlutterFlowDropDown<String>(
|
||||
controller: _issueController,
|
||||
onChanged: (val) {
|
||||
widget.model['id'] = val;
|
||||
final targetId = widget.model['id'];
|
||||
final matchedDevice =
|
||||
bodyDeviceController.deviceList.firstWhere(
|
||||
(device) => device['_id'] == targetId,
|
||||
orElse: () => null, // 如果找不到,返回 null(可选)
|
||||
);
|
||||
if (matchedDevice != null) {
|
||||
// 找到了匹配的项
|
||||
widget.model['param'] = matchedDevice['mac'];
|
||||
widget.model['mac'] = matchedDevice['mac'];
|
||||
widget.model['code'] =
|
||||
matchedDevice['code'] ?? '';
|
||||
widget.model['name'] = (matchedDevice['person']
|
||||
?['name']
|
||||
?.toString()
|
||||
.trim()
|
||||
.isNotEmpty ??
|
||||
false)
|
||||
? matchedDevice['person']['name']
|
||||
: '未命名'.tr;
|
||||
repairController.updateAll();
|
||||
}
|
||||
},
|
||||
width: 200.rpx,
|
||||
height: 40.rpx,
|
||||
@@ -127,7 +157,7 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
isOverButton: false,
|
||||
isSearchable: false,
|
||||
isMultiSelect: false,
|
||||
controller: _deviceController,
|
||||
// controller: _deviceController,
|
||||
options: repairController.deviceListId!,
|
||||
optionLabels: repairController.deviceListId!,
|
||||
),
|
||||
@@ -155,84 +185,87 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.rpx),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: repairController.onReDraw(
|
||||
TextEditingController(
|
||||
text: widget.model['param']),
|
||||
(textEditingController) {
|
||||
textEditingController.text = widget.model['param'];
|
||||
}),
|
||||
// initialValue: widget.model['param'],
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.fontStyle,
|
||||
Obx(() {
|
||||
return Expanded(
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.rpx),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: repairController.onReDraw(
|
||||
TextEditingController(
|
||||
text: widget.model['param']),
|
||||
(textEditingController) {
|
||||
textEditingController.text =
|
||||
widget.model['param'];
|
||||
}),
|
||||
// initialValue: widget.model['param'],
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.fontWeight,
|
||||
fontStyle: FlutterFlowTheme.of(context)
|
||||
.labelMedium
|
||||
.fontStyle,
|
||||
),
|
||||
hintText: "设备参数提示".tr,
|
||||
hintStyle: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0x00000000),
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: themeController.currentColor.sc15,
|
||||
),
|
||||
hintText: "设备参数提示".tr,
|
||||
hintStyle: TextStyle(
|
||||
style: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0x00000000),
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.transparent,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).error,
|
||||
width: 1.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: themeController.currentColor.sc15,
|
||||
cursorColor: themeController.currentColor.sc3,
|
||||
onChanged: (value) {
|
||||
widget.model['param'] = value;
|
||||
},
|
||||
),
|
||||
style: TextStyle(
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
cursorColor: themeController.currentColor.sc3,
|
||||
onChanged: (value) {
|
||||
widget.model['param'] = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
].divide(SizedBox(width: 24.rpx)),
|
||||
),
|
||||
),
|
||||
@@ -246,11 +279,16 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
child: TextFormField(
|
||||
controller: repairController.onReDraw(
|
||||
TextEditingController(text: widget.model['issue']),
|
||||
(textEditingController) {
|
||||
textEditingController.text = widget.model['issue'];
|
||||
}),
|
||||
onChanged: (value) {
|
||||
widget.model['issue'] = value;
|
||||
},
|
||||
maxLines: null, // 👈 支持无限行
|
||||
controller: TextEditingController(),
|
||||
// controller: TextEditingController(),
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
@@ -385,7 +423,7 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
})),
|
||||
),
|
||||
),
|
||||
if (widget.length > 1)
|
||||
if (widget.length > 1 && widget.showDelete == true)
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
100.rpx, 0.rpx, 100.rpx, 0.rpx),
|
||||
@@ -428,7 +466,7 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 29.rpx)),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user