Home > Mobile >  How Can I make a TextWidget wrap in Row?
How Can I make a TextWidget wrap in Row?

Time:03-08

enter image description here

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

CodePudding user response:

Why don't just use RichText instead of Row? Less code, more possibilities.

CodePudding user response:

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...

  • Related