Ad

Flutter How Can I Change Floating Label Position?

- 1 answer

I have a simple login form. But i want to change floating label position. I dont want floating label go on border. For make it more clear : Its how i want :

Before Focus:

enter image description here

After Focus:

enter image description here

How can i make it ? Thanks for help!

Ad

Answer

TextField(
                    style: Theme.of(context).textTheme.headline3,
                    keyboardType: TextInputType.number,
                    onChanged: (value) {
                    },
                    decoration: InputDecoration(
                      border: InputBorder.none,
                      fillColor: Colors.black12,
                      filled: true,
                      labelText: 'Enter here'
                    ),
                  ),
             

try this

Ad
source: stackoverflow.com
Ad