0

I am making this showcaseview in my app using this library. But I have a long text as the description. But the text will just be in one line like this:

Showcase image

I really want the text to be in multiple lines. A solution would be to do \n to make it a new line, but i would have to do that every time i think it is a long line, and it would be a nightmare.

Is there a better way i could do this?

This is my code:

Showcase(
            key: _graph,
            title: 'Diagram',
            description:
                'This is a long description. This is a long description. This is a long description. This is a long description. This is a long description. This is a long description. ',
            child: Container(
              height: _size.height * 0.3,
              child: Diagram()
            ),
          ),
Toke-dk
  • 53
  • 7

2 Answers2

0

Show Case View is supposed to provide a short description of your widget not show multi lines and long descriptions.

For a Text you can try this:

Container(
  width: 100,
  child: Text(
    'This is a long description. This is a long description. This is a long description. This is a long description. This is a long description. This is a long description. ',
    maxLines: 2,
    overflow: TextOverflow.ellipsis,
  ),
),
  • Yeah. But the problem is that the description for the Showcase, is not a Text widget but a String. – Toke-dk Apr 03 '21 at 11:26
  • Yeah I know there's no mention of multi-line description in their documentation. So if you do want to provide a very long description you'll have to do it the hard way –  Apr 03 '21 at 11:50
0

If you want to provide a longer or custom description try using Showcase.withWidget() instead of just Showcase(). It takes a container property where you can build a custom description widget that incorporates things like RichText().

Andrej
  • 2,743
  • 2
  • 11
  • 28
Jet
  • 1