|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
|
|
|
|
import '../../../res/colors.dart';
|
|
|
|
import '../../../utils/screen_util.dart';
|
|
|
|
|
|
|
|
class WineSettingMsgPage extends StatefulWidget {
|
|
|
|
const WineSettingMsgPage();
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<WineSettingMsgPage> createState() => _WineSettingMsgPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _WineSettingMsgPageState extends State<WineSettingMsgPage> {
|
|
|
|
String contentChangeStart = '尊敬的@var(clientname),您好!您的酒水@var(beveragename)已经在我店存放@var(days)了。点击这里编辑您的短信内容。上面的文字时固定不可编辑的。';
|
|
|
|
TextEditingController controller = TextEditingController();
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: SystemAppBar('fff'),
|
|
|
|
body: SingleChildScrollView(child:
|
|
|
|
Column(children: [
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.all(w(10)),
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_DBDBDB, width: w(1)),
|
|
|
|
borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
contentChangeStart,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.5,
|
|
|
|
color: MyColours.color_66000000,
|
|
|
|
fontSize: font(14)),
|
|
|
|
),
|
|
|
|
TextField(
|
|
|
|
enabled: true,
|
|
|
|
controller: controller,
|
|
|
|
// textAlign: TextAlign.right,
|
|
|
|
// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
maxLines: 10,
|
|
|
|
|
|
|
|
// inputFormatters: title == '金额'
|
|
|
|
// ? [
|
|
|
|
// FilteringTextInputFormatter(RegExp("[0-9.]"),
|
|
|
|
// allow: true),
|
|
|
|
// MyNumberTextInputFormatter(digit: 2),
|
|
|
|
// ]
|
|
|
|
// : [],
|
|
|
|
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
// focusNode: focusNode,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
border:
|
|
|
|
OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
hintText:
|
|
|
|
'以上内容为固定不可编辑,点击这里开始编辑短信内容' ,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
//添加的代码:光标一直在文本框后面
|
|
|
|
// controller.value = TextEditingValue(
|
|
|
|
// text: controller.text,
|
|
|
|
// selection:
|
|
|
|
// TextSelection.fromPosition(TextPosition(
|
|
|
|
// affinity: TextAffinity.downstream,
|
|
|
|
// offset: controller.text.length,
|
|
|
|
// )));
|
|
|
|
// setState(() {
|
|
|
|
// _cursorPosition = controller.selection.baseOffset;
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
// keyboardType: inputType,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],),),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|