Aquarius_Girl
Aquarius_Girl

Reputation: 22936

How to align text in RichText area in Flutter?

RichText(
          text: TextSpan(
                   text: '•   ',                                            
          
                   children: <TextSpan>[
                      TextSpan(text: list2[1],),
                   ],
          ),       
),

Here I want the text: '• ' to have left-center alignment.

What is the way to achieve that?

Upvotes: 2

Views: 208

Answers (1)

Jahidul Islam
Jahidul Islam

Reputation: 12575

try with Align

Align(
              alignment: Alignment.centerLeft,
              child: RichText(
                text: TextSpan(
                  text: '.  ',
                  style: TextStyle(color: Colors.black),
                  children: <TextSpan>[
                    TextSpan(text: list2[1],),
                  ],
                ),
              ),
            ),

Upvotes: 3

Related Questions