Displaying charachters in a text widget in flutter

Issue

How do i display something like this in my text widget in flutter?enter image description here

Solution

You can use RichText , providing the dot as an Circle Avatar and other 2 widgets the text you want .

                RichText(
            text:TextSpan(
              children:[
                TextSpan(
                  text:"Mon, 19 April ",
                  style:TextStyle(
                    color:Colors.blueAccent,
                  ),
                ),
                WidgetSpan(
                  child: Padding(
                    padding: EdgeInsets.symmetric(vertical:5.0,),
                    child: CircleAvatar(
                      radius:3,
                      backgroundColor:Colors.blueAccent,
                    ),
                  ),
                ),
                TextSpan(
                  text:" 06:00 PM",
                  style:TextStyle(
                    color:Colors.blueAccent,
                  ),
                ),
              ]
            ),
          ),

Hope it works for you.

Answered By – Vinay Jain

Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.