Поскольку я новичок во Flutter, я не совсем уверен, как это сделать правильно, и буду признателен за любую помощь.
Версии:< /p>
- Flutter 3.19.5
- Dart 3.3.3
Код: Выделить всё
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('My App'),
),
body: Center(
child: FractionallySizedBox(
widthFactor: 0.5,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Image.asset("assets/logo/logo.png"),
),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 50),
child: TextField(
style: TextStyle(
fontSize: 80.0, height: 2.0, color: Colors.white60),
autofocus: true,
controller: _controller,
focusNode: _focusnode,
textAlign: TextAlign.center,
autocorrect: false,
enableSuggestions: false,
keyboardType: TextInputType.number,
onSubmitted: (newValue) {
// does something
},
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
border: UnderlineInputBorder(),
alignLabelWithHint: true,
hintText: 'z.B.: 1092831023',
hintStyle: TextStyle(
fontSize: 80.0, height: 2.0, color: Colors.white60),
),
),
),
],
),
),
),
drawer: MyDrawer(),
);
}
Код: Выделить всё
keyboardType: TextInputType.noneПодробнее здесь: https://stackoverflow.com/questions/782 ... tfield-but