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), ), ); }