title: How to limit text length of a TextSpan widget
body: <p>I'm new to Flutter. How to limit text when I use <code>TextSpan</code> widget?</p>
  <p>My code</p>
  <pre><code>Widget build(BuildContext context) {
      return Padding(
        padding: const EdgeInsets.symmetric(vertical: 8.0),
        child: Row(
          children: &lt;Widget&gt;[
            Expanded(
              flex: 2,
              child: Row(
                children: &lt;Widget&gt;[
                  Stack(
                    children: &lt;Widget&gt;[
                      ClipRRect(
                        borderRadius: BorderRadius.all(Radius.circular(8)),
                        child: Image.asset(
                          lastPlayedGame.imagePath,
                          height: 60,
                          width: 45,
                          fit: BoxFit.cover,
                        ),
                      ),
                      Positioned(
                        left: 8,
                        right: 8,
                        top: 0,
                        bottom: 0,
                        child: Container(
                          decoration: BoxDecoration(
                            shape: BoxShape.circle,
                            color: Colors.white,
                          ),
                          child: Icon(
                            Icons.play_arrow,
                            color: Colors.red,
                          ),
                        ),
                      ),
                    ],
                  ),
                  Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 12),
                    child: RichText(
                      text: TextSpan(children: [
                        TextSpan(text: lastPlayedGame.name, style: headingTwoTextStyle,),
                        TextSpan(text: '\n'),
                        TextSpan(text: &quot;${lastPlayedGame.hoursPlayed} hours played&quot;, style: bodyTextStyle),
                      ]),
                    ),
                  )
                ],
              ),
            ),
            Expanded(
              child: GameProgressWidget(screenWidth: screenWidth, gameProgress: gameProgress),
            ),
          ],
        ),
      );
    }
  }
  </code></pre>
  <p>When run on my Android device, I get an error:</p>
  <blockquote>
  <p>A RenderFlex overflowed by 15 pixels on the right.</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/FG90c.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FG90c.jpg" alt="enter image description here" /></a></p>
  <p>How to limit text length? Maybe check if text is maximum of screen, will show <code>Assasin's Creed...</code> (with dots maybe?)</p>