Container(
height: 36,
child: TextField(
maxLines: 1,
style: TextStyle(fontSize: 17),
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
filled: true,
prefixIcon:
Icon(Icons.search, color: Theme.of(context).iconTheme.color),
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(30))),
fillColor: Theme.of(context).inputDecorationTheme.fillColor,
contentPadding: EdgeInsets.zero,
hintText: 'Search',
),
),
)
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none,
),
References
https://stackoverflow.com/questions/55980852/how-to-center-textfield-inside-container
How to center TextField inside Container?
I want to center the TextField inside Container but they are aligned to the left. @override Widget build(BuildContext context) { // TODO: implement build return Scaffold( appBar: AppBar( ...
stackoverflow.com
https://stackoverflow.com/questions/54307673/flutter-textfield-background-color-on-focus
Flutter textfield background color on focus
I have a rounded textfield. It works well, but when the user taps on it, a grey color background appears. How can I disable that splash effect? This is my code and result: new Container( ...
stackoverflow.com
728x90
'Flutter' 카테고리의 다른 글
| [Flutter] restrict textfield input type & setting keyboard type (0) | 2022.04.28 |
|---|---|
| [Flutter] flutter close keyboard on textfield submit(close-hide-keyboard) (0) | 2022.04.28 |
| [Flutter] flutter remove textfield underline (0) | 2022.04.28 |
| [Flutter] dart get index of list by item (0) | 2022.04.27 |
| [Flutter] How can i get int data from TextEditingController in flutter (0) | 2022.04.27 |