Himani
Himani

Reputation: 165

create textformfield like the image

I want label text inside the border. found some example with container, but the container border will not be change color with error. Container blank : grey color, if it's having error thn red and if it's satisfying condition thn green like image.

image

Upvotes: 0

Views: 172

Answers (1)

Captivity
Captivity

Reputation: 338

You can try:

TextField(
              decoration: InputDecoration(
                filled: true,
                fillColor: Colors.white,
                labelText: "Label",
                hintText: "Input Text",
                contentPadding: EdgeInsets.fromLTRB(32, 16, 32, 16),
                border: OutlineInputBorder(
                  borderRadius: BorderRadius.circular(8),
                ),
              ),
            ),

Or something like in that comment: https://stackoverflow.com/a/68388525/6942599

Upvotes: 1

Related Questions