204 lines
9.5 KiB
Dart
204 lines
9.5 KiB
Dart
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
|
import 'package:ef/ef.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
|
|
|
class EditBedPage extends StatefulWidget {
|
|
const EditBedPage({Key? key}) : super(key: key);
|
|
@override
|
|
_EditBedPageState createState() => _EditBedPageState();
|
|
}
|
|
|
|
BoxConstraints? bodysize;
|
|
RxString _bedName = "".obs;
|
|
|
|
class _EditBedPageState extends State<EditBedPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return LayoutBuilder(builder: (context, cc) {
|
|
bodysize = cc;
|
|
return GestureDetector(
|
|
onTap: () {
|
|
FocusScope.of(context).requestFocus(FocusNode());
|
|
},
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
|
fit: BoxFit.fill, // 填满整个 Container
|
|
),
|
|
),
|
|
child: Scaffold(
|
|
backgroundColor: Colors.transparent,
|
|
appBar: AppBar(
|
|
backgroundColor: Colors.transparent,
|
|
iconTheme: const IconThemeData(color: Colors.white),
|
|
automaticallyImplyLeading: false,
|
|
titleSpacing: 0,
|
|
title: SizedBox(
|
|
width: double.infinity,
|
|
height: 180.rpx,
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
// 中间居中的标题
|
|
Text(
|
|
'智能床名称',
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 30.rpx,
|
|
),
|
|
),
|
|
// 左侧图标
|
|
Positioned(
|
|
left: 20.rpx,
|
|
child: returnIconButtomNew,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
centerTitle: false,
|
|
),
|
|
body: SafeArea(
|
|
top: true,
|
|
child: Padding(
|
|
padding: EdgeInsets.only(top: 40.rpx),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Container(
|
|
width: bodysize!.maxHeight * 1,
|
|
height: bodysize!.maxHeight * 0.335,
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Container(
|
|
child:
|
|
Image.asset('assets/images/bed_name.png'),
|
|
width: bodysize!.maxWidth * 0.69,
|
|
height: 193.rpx,
|
|
),
|
|
Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(horizontal: 60.rpx),
|
|
child: Container(
|
|
alignment: Alignment.center,
|
|
height: bodysize!.maxHeight * 0.076,
|
|
decoration: const BoxDecoration(
|
|
border: Border(
|
|
bottom: BorderSide(
|
|
color: Color(0xFF929699),
|
|
width: 0))),
|
|
child: TextFormField(
|
|
// autofocus: true,
|
|
obscureText: false,
|
|
onChanged: (val) {
|
|
// controller.model.name = val;
|
|
},
|
|
textAlign: TextAlign.center,
|
|
initialValue: _bedName.value,
|
|
decoration: InputDecoration(
|
|
hintText: "请输入床的名称",
|
|
contentPadding:
|
|
const EdgeInsetsDirectional
|
|
.fromSTEB(10, 0, 10, 0),
|
|
labelStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily: 'Readex Pro',
|
|
letterSpacing: 0,
|
|
fontSize: 36.rpx, // 设置输入文字大小
|
|
color: Colors.white, // 设置输入文字颜色
|
|
),
|
|
hintStyle: FlutterFlowTheme.of(context)
|
|
.labelMedium
|
|
.override(
|
|
fontFamily: 'Readex Pro',
|
|
letterSpacing: 0,
|
|
color: Color(0xFF929699),
|
|
fontSize: 36.rpx,
|
|
),
|
|
enabledBorder: UnderlineInputBorder(
|
|
borderSide: const BorderSide(
|
|
color: Color(0x00000000),
|
|
width: 2,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8),
|
|
),
|
|
focusedBorder: UnderlineInputBorder(
|
|
borderSide: const BorderSide(
|
|
color: Color(0x00000000),
|
|
width: 2,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8),
|
|
),
|
|
errorBorder: UnderlineInputBorder(
|
|
borderSide: const BorderSide(
|
|
color: Color(0x00000000),
|
|
width: 2,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8),
|
|
),
|
|
focusedErrorBorder:
|
|
UnderlineInputBorder(
|
|
borderSide: const BorderSide(
|
|
color: Color(0x00000000),
|
|
width: 2,
|
|
),
|
|
borderRadius:
|
|
BorderRadius.circular(8),
|
|
),
|
|
),
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily: 'Readex Pro',
|
|
letterSpacing: 0,
|
|
),
|
|
),
|
|
))
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.only(
|
|
left: 30.rpx, right: 30.rpx, bottom: 85.rpx),
|
|
child: CustomCard(
|
|
borderRadius: 16.rpx,
|
|
gradientDirection: GradientDirection.vertical,
|
|
onTap: () {},
|
|
colors: const [
|
|
Color(0xFFFCFCFC),
|
|
Color(0xFFF8FAF9),
|
|
Color(0XFFECF6F3),
|
|
Color(0XFFD9F0E9),
|
|
Color(0xFFCEECE3)
|
|
],
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: 90.rpx,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(6),
|
|
),
|
|
child: Text("完成",
|
|
style: TextStyle(
|
|
color: const Color(0xFF003058),
|
|
fontSize: 26.rpx)),
|
|
),
|
|
))
|
|
],
|
|
))),
|
|
),
|
|
),
|
|
);
|
|
});
|
|
}
|
|
}
|