Answers for "flutter text field with right icon"

1

add a leading icon to text field in flutter

TextField(
//    ...,other fields
      decoration: InputDecoration(
        prefixIcon: prefixIcon??Icon(Icons.done),
      ),
    ),
Posted by: Guest on June-10-2020
2

flutter text with icon

Flutter has WidgetSpan() to add a widget inside the RichText().

Example use:

RichText(
  text: TextSpan(
    children: [
      TextSpan(
        text: "Click ",
      ),
      WidgetSpan(
        child: Icon(Icons.add, size: 14),
      ),
      TextSpan(
        text: " to add",
      ),
    ],
  ),
)

Above code will produce:

Click + to add

You can treat the child of WidgetSpan like the usual widget.
Posted by: Guest on April-18-2021

Code answers related to "flutter text field with right icon"

Browse Popular Code Answers by Language