Advertisement
Guest User

Untitled

a guest
Mar 7th, 2021
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.13 KB | None | 0 0
  1. TextField(
  2.                   onTap: (){
  3.                     if(AddNewController.to.textNameInputData.value != "") AddNewController.to.suffixNameVisibility.value = true;
  4.                     else AddNewController.to.suffixNameVisibility.value = false;
  5.                   },
  6.                   onSubmitted: (String str){
  7.                     AddNewController.to.suffixNameVisibility.value = false;
  8.                     textNameEditingController.clear();
  9.                     AddNewController.to.textNameInputData.value = str;
  10.                   },
  11.                   onChanged: (String str){
  12.                     AddNewController.to.textNameInputData.value = str;
  13.                     textNameEditingController = TextEditingController(text: str);
  14.                     if(str != "") AddNewController.to.suffixNameVisibility.value = true;
  15.                     else AddNewController.to.suffixNameVisibility.value = false;
  16.                   },
  17.                   minLines: 1,
  18.                   textCapitalization: TextCapitalization.sentences,
  19.                   style: TextStyle(fontSize: midFont, color: Color.fromARGB(255, 90, 90, 90),),
  20.                   cursorColor: Color.fromARGB(255, 90, 90, 90),
  21.                   controller: textNameEditingController,
  22.                   maxLines: 1,
  23.                   decoration: InputDecoration(
  24.                     suffixIcon: IconButton(
  25.                       onPressed: (){
  26.                         print("123");
  27.                         //textNameEditingController = null;
  28.                         textNameEditingController = TextEditingController(text: "");
  29.                         AddNewController.to.suffixNameVisibility.value = false;
  30.                       },//TextEditingController(text: '');},
  31.                       icon: Container(
  32.                         child: Visibility(
  33.                             visible: AddNewController.to.suffixNameVisibility.value,
  34.                                 child: Icon(Icons.clear))),
  35.                       color: Colors.redAccent,
  36.                     ),
  37.                     hintText: "Введите имя",
  38.                     hintStyle: TextStyle(fontSize: midFont, color: Color.fromARGB(255, 105, 116, 127)),
  39.                   ),
  40.  
  41. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement