skip to Main Content

I want to create a Flutter widget like this image. ‘Icon’ is a text.
enter image description here

I read the material design demo of Flutter. But I can’t create or find a widget like widget in given image. I am a newbie in Flutter. Thank you.

2

Answers


  1. Use TextField with label property like this

     TextField(
                          decoration: InputDecoration(
                            labelText: 'Icon',
                            
                            focusedBorder: OutlineInputBorder(),
                          ),
                        )
    

    enter image description here

    Login or Signup to reply.
  2. If you don’t want to use a TextField like the other answer suggest you can use InputDecorator

    example:

    InputDecorator(
      child: Text("TEST"),
      decoration: InputDecoration(
        labelText: "lalala",
      ),
    )
    

    result:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search