본문 바로가기
Flutter

[Flutter] Textfield 속성

by hymndaniel 2022. 4. 28.
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