Commit ffdc4f76e38ca85c90fba2d3542c90eb32cca172

Authored by wdn127929
1 parent f63ae2d7

textfeild 自定义selection粘贴选项

... ... @@ -46,11 +46,16 @@ class _EditReserverPageState extends State<EditReserverPage> {
@override
void initState() {
super.initState();
_myExtendedMaterialTextSelectionControls =
MyTextSelectionControls(callback: (value) {
// detailModel.phoneController.text = value;
detailModel.phoneController.value = TextEditingValue(
text: value,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
WidgetsBinding.instance.addPostFrameCallback((_) {
_myExtendedMaterialTextSelectionControls =
MyTextSelectionControls(callback: (value) {
detailModel.phoneController.text = value;
});
if (widget.name != '' &&
widget.name != null &&
widget.sex != '' &&
... ...
... ... @@ -93,7 +93,11 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
_myExtendedMaterialTextSelectionControls =
MyTextSelectionControls(callback: (value) {
_notebookDetailChangeModel.phoneController.text = value;
_notebookDetailChangeModel.phoneController.value = TextEditingValue(
text: value,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
_notebookDetailChangeModel.currTimeIndex =
int.parse(widget.detailEntity.ddate_solt);
... ... @@ -124,7 +128,10 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
item.selected = true;
}
nameStr = _notebookDetailChangeModel.nameController.text;
_addNameSuffix(nameStr, _nameSuffix());
if (nameStr != '' && nameStr != null) {
_addNameSuffix(nameStr, _nameSuffix());
}
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid
};
... ... @@ -635,7 +642,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
children: [
Expanded(
child: TextField(
selectionControls: _myExtendedMaterialTextSelectionControls,
// selectionControls: _myExtendedMaterialTextSelectionControls,
maxLines: 1,
//输入文本的样式
style: TextStyle(
... ... @@ -1616,6 +1623,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
color: MyColours
.color_efefef))),
child: TextField(
selectionControls:
_myExtendedMaterialTextSelectionControls,
maxLines: 1,
//输入文本的样式
style: TextStyle(
... ...
... ... @@ -110,7 +110,12 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
WidgetsBinding.instance.addPostFrameCallback((_) async {
_myExtendedMaterialTextSelectionControls =
MyTextSelectionControls(callback: (value) {
detailModel.phoneController.text = value;
detailModel.phoneController.value = TextEditingValue(
text: value,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
_initCancel();
_getReserveDetail();
... ...
... ... @@ -113,7 +113,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
// _getSetmeal();
_myExtendedMaterialTextSelectionControls =
MyTextSelectionControls(callback: (value) {
phoneC.text = value;
phoneC.value = TextEditingValue(
text: value,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
_getData();
});
... ...
... ... @@ -208,7 +208,11 @@ class InvicationPageState extends State<InvicationPage>
WidgetsBinding.instance.addPostFrameCallback((_) async {
_myExtendedMaterialTextSelectionControls =
MyTextSelectionControls(callback: (value) {
_baseIndoProvider.phoneController.text = value;
_baseIndoProvider.phoneController.value = TextEditingValue(
text: value,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
couponProvider.sendSMS = 0;
await _couponNetworkData(isShowLoading: false);
... ...
... ... @@ -123,7 +123,11 @@ class TableManagerPageState extends State<TableManagerPage> {
_myExtendedMaterialTextSelectionControls =
MyTextSelectionControls(callback: (value) {
_baseIndoProvider.phoneController.text = value;
_baseIndoProvider.phoneController.value = TextEditingValue(
text: value,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
tableManagerModel.initTime(context);
... ...