А
Size: a a a
А
СП
А
А
RegExp(r"^[а-яА-Я][a-zA-Z]{1,50}$");
AZ
AZ
А
Аp
А
AP
Аp
Аp
AP
AP
Аp
N
А
InputDecoration
есть hintTextN
N
class _profilState extends State<profil> {
TextEditingController _editingController;
String initialText;
setInitialName(String initialName)async{
initialName = await Storage().secureStorage.read(key: "name");
if (initialText == null){
initialName = 'Ваше имя';
}
return initialName;
}
@override
void initState(){
super.initState();
_editingController = TextEditingController();
}
@override
void dispose() {
_editingController.dispose();
super.dispose();
}
void setName(String newName)async{
await Storage().secureStorage.write(key: "name", value: newName);
}
// Widget _editTitleTextField() {
// if (_isEditingText)
// return Center(
// child: TextField(
// onSubmitted: (newValue)async{
// setState(() {
// initialText = newValue;
// setName(newValue);
// _isEditingText =false;
// });
// },
// autofocus: true,
// controller: _editingController,
// ),
// );
// return InkWell(
// onTap: () {
// setState(() {
// _isEditingText = true;
// });
// },
// child: Text(
// initialText??"Ваше имя",
// style: TextStyle(
// color: Colors.black,
// fontSize: 18.0,
// ),
// ),
// );
// }
@override
Widget build(BuildContext context) {
/// To set and edit Namevar _profile = Padding(
padding: EdgeInsets.only(top: 280.0, left: 40.0, right: 40.0),
child: SizedBox(
child: Container(
padding: EdgeInsets.all(10),
child: Center(
child: TextField(
onSubmitted: (value){
setName(value);
},
autofocus: false,
controller: _editingController
..text = Auth().name, //this is your text
),
),
),
),
);