4

I want to design the flutter text field like this can anyone help me.

enter image description here

Rakesh Shriwas
  • 611
  • 2
  • 7
  • 15

2 Answers2

8
Container(
          padding: EdgeInsets.fromLTRB(10,2,10,2),
          decoration: BoxDecoration(
             borderRadius: BorderRadius.circular(5),
             border: Border.all(color: Colors.red)
          ),
          child: TextField(

            decoration: InputDecoration(
              border: InputBorder.none,
              labelText: "First Name",
            ),
            controller: controller,
          ),
        )
Ishan Fernando
  • 2,758
  • 1
  • 31
  • 38
  • When I have multiple text field and I am focused only on one text field then how to show active text field border red and rest of the grey. – Rakesh Shriwas Jan 15 '20 at 05:41
  • you can set a selected textfield when tap and build the widget tree.Then check the select one and set the border based on that. But not sure whether it a correct way of doing. – Ishan Fernando Jan 15 '20 at 17:06
-1

Use 'labelText' for showing label on top of editfield.

Bibin Baby
  • 163
  • 1
  • 3