I want to create a Flutter widget like this image. ‘Icon’ is a text.
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
Use TextField with label property like this
TextField
TextField( decoration: InputDecoration( labelText: 'Icon', focusedBorder: OutlineInputBorder(), ), )
If you don’t want to use a TextField like the other answer suggest you can use InputDecorator
InputDecorator
example:
InputDecorator( child: Text("TEST"), decoration: InputDecoration( labelText: "lalala", ), )
result:
Click here to cancel reply.
2
Answers
Use
TextField
with label property like thisIf you don’t want to use a
TextField
like the other answer suggest you can useInputDecorator
example:
result: