From d4437f0ed95524b821d3332e3056fbec82385033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDaisyWu=E2=80=9D?= <“18682150237@163.com”> Date: Tue, 2 Jul 2024 14:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=9F=AD=E4=BF=A1=E6=A8=A1?= =?UTF-8?q?=E7=89=88=E3=80=81=E9=82=AE=E4=BB=B6=E6=A8=A1=E7=89=88=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=90=8D=E7=A7=B0=E5=BA=94=E9=99=90=E5=88=B650?= =?UTF-8?q?=E4=BD=8D=E4=BD=8D=E6=95=B0=EF=BC=8C=E5=8F=AF=E5=88=863?= =?UTF-8?q?=E8=A1=8C=E5=85=A8=E9=83=A8=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E4=B8=8D=E8=83=BD=E9=87=8D=E5=90=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newSMSTemplate_page.dart | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/lib/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart b/lib/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart index afee8c2f..9435ffa9 100755 --- a/lib/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart +++ b/lib/mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/newSMSTemplate_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_colors.dart'; @@ -28,7 +29,7 @@ class _NewSMSTemplatePageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: state.templateType == 1 ? '新建短信模版'.tr : '新建邮件模版'.tr, + barTitle: state.templateType.value == 1 ? '新建短信模版'.tr : '新建邮件模版'.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), @@ -222,26 +223,32 @@ class _NewSMSTemplatePageState extends State { Widget getTFWidget(TextEditingController tfController, String tfStr) { return SizedBox( - height: 50.h, - width: 300.w, - child: Row( - children: [ - Expanded( - child: TextField( - maxLines: 1, - controller: tfController, - autofocus: false, - textAlign: TextAlign.end, - style: TextStyle(fontSize: 22.sp), - decoration: InputDecoration( - contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), - hintText: tfStr, - hintStyle: TextStyle(fontSize: 22.sp), - border: InputBorder.none, - ), - ), - ), + height: 65.h, + width: 320.w, + child: TextField( + controller: tfController, //输入框一行 + maxLines: 3, + inputFormatters: [ + FilteringTextInputFormatter.deny('\n'), + LengthLimitingTextInputFormatter(50), ], + autofocus: false, + textAlign: TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + hintText: tfStr, + hintStyle: TextStyle(fontSize: 22.sp), + focusedBorder: const OutlineInputBorder( + borderSide: BorderSide(width: 0, color: Colors.transparent)), + disabledBorder: const OutlineInputBorder( + borderSide: BorderSide(width: 0, color: Colors.transparent)), + enabledBorder: const OutlineInputBorder( + borderSide: BorderSide(width: 0, color: Colors.transparent)), + border: const OutlineInputBorder( + borderSide: BorderSide(width: 0, color: Colors.transparent)), + contentPadding: EdgeInsets.only(top: 20.h, bottom: 0)), + style: + TextStyle(fontSize: 22.sp, textBaseline: TextBaseline.alphabetic), ), ); }