suragch / mongol

Mongolian vertical script widgets for Flutter apps
https://pub.dev/packages/mongol
BSD 3-Clause "New" or "Revised" License
70 stars 15 forks source link

Add a MongolParagraph.dispose() method? #37

Open suragch opened 1 year ago

suragch commented 1 year ago

ui.Paragraph has a dispose() method, which TextPainter calls. Should MongolParagraph also add this? I'm not adding it yet because it would require looping through all of the _runs and disposing every Paragraph. Having these runs available potentially allows MongolParagraph to relayout itself when the height changes without having to recalculate every run. That's something that a normal Paragraph doesn't do. So it seems like a performance advantage to not dispose everything. But this is untested. Maybe disposing would be an advantage.