Search code examples
fluttermaterial-uimaterial-design

How can I Create 'TextField' where Label is inside TextFields's border in Flutter


I am looking for a way to modify TextField Widget in Flutter in a way that it's label is displayed in it's border. Is there any property that 'TextField' have to achieve this? or any other way that I could implement it.

I want to achieve something like this. Customized TextField


Solution

  • TextField(
      decoration: InputDecoration(
      hintText: 'Enter your name',
      label: Text('Name'),
      border: OutlineInputBorder(),
      ),
    ),
    

    enter image description here