How to format the background color for a positioned block of text?

Posted by Jessica Taylor | Updated on

Want to format the background color for a positioned block of text? Just nest the Text element as a child within the Container that has the BoxDecoration the Container will stretch to fit the Text inside. Additionally, one can specify padding for that Container, which eliminates the need to hardcode a width/height for the box.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers