How Can I make a TextWidget wrap in Row?

Issue

How Can I make the orange text break to the start of the row instead of breaking to the start of itself?

TextWidget Wrap in Row:
TextWidget Wrap in Row

Solution

If you use Richtext like that:

return Container(
        height: 175,
        width: 150,
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(20),
        ),
        child: Padding(
            padding: const EdgeInsets.only(left: 25, top: 100,),
            child: RichText(
                text: const TextSpan(children: <TextSpan>[
          TextSpan(
            text: 'I agree with the ',
            style: TextStyle(
              color: Colors.black,
              fontSize: 12,
            ),
          ),
          TextSpan(
            text: 'privacy_policiesfkads;ljfklas;dj',
            style: TextStyle(
              color: Colors.orange,
              fontSize: 12,
              fontWeight: FontWeight.bold,
            ),
          ),
        ]))));

you should be able to achieve everything you want in terms of design and scaling and also positioning…

Answered By – Jonas Jacob Biermann

Answer Checked By – Senaida (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.