Santhosh
Santhosh

Reputation: 223

Set Icon at the end pf textfield Flutter

I need a FormField which contains both suffixIcon and Ordinary icon in a single row.

Upvotes: 1

Views: 5865

Answers (2)

Lalit Rawat
Lalit Rawat

Reputation: 1272

You can use Row and add icon anywhere you want.

Container(
    child: Row(
    children: <widget>[
        Icon(),
        Icon(),
        Expanded(child: TextField()),
        Icon(),
        Icon(), 
    ]),
),

Upvotes: 0

Muldec
Muldec

Reputation: 4901

Here are the three ways to add icons to your textfield

TextField(
  controller: ...,
  decoration: InputDecoration(
    icon: Icon(...), //Icon outside
    prefixIcon: Icon(...), //Icon at the beginning
    suffixIcon: Icon(...), //Icon at the end
  ),
),

Upvotes: 4

Related Questions