znjameswu / flutter_math

Math rendering and editing in pure Flutter.
https://znjameswu.github.io/flutter_math_demo/
Apache License 2.0
123 stars 52 forks source link

Handle overflow #14

Closed MidhunrajXYZ closed 3 years ago

MidhunrajXYZ commented 3 years ago

Hi, Great project first of all. Thank you so much.

Is it possible to handle the overflow some way? I am trying to insert equations to some text.

Here is an example text with equation:r' \text {What is the value of } \frac {20} {30} \text {in decimal?} '

The problem is that the whole thing is one line and it is clipped of or overflowed the container. I want it to have the behavior of a normal text widget, like, automatically create new lines so that the texts wont overflow or clipped out of the container.

Is there a built-in option for that? If there is not, what would I have to do to achieve the same behavior? Thanks a lot for your help.

znjameswu commented 3 years ago

Thank you for liking this library!

Currently there is still no support for auto-wrap features. The reasons are discussed in https://github.com/znjameswu/flutter_math/issues/8 . This is somewhat non-trivial due to Flutter's layout system. However this is definitely on the roadmap. I'm still trying to come up with a good design for it.

For now, you can probably mitigate this problem by using a smaller fontSize / wrap it inside a scrollable.

MidhunrajXYZ commented 3 years ago

Oh, there was already filed a similar issue., I am closing this then. Looking forward for the feature to be implemented. Thanks.