feat: Add accessor to determine a TextElement size #3130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add accessor to determine a
TextElement
size.Currently, there is no way to figure out the actual size of a
TextElement
.This is quite important as the element will have the lines laid out and broken down, so we need a way to determine the height of the resulting bounding box.
Before:
![](https://private-user-images.githubusercontent.com/882703/323640332-5d69d9dd-068f-4deb-8dd6-19c90aca01db.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNjg1NjksIm5iZiI6MTcyMzA2ODI2OSwicGF0aCI6Ii84ODI3MDMvMzIzNjQwMzMyLTVkNjlkOWRkLTA2OGYtNGRlYi04ZGQ2LTE5YzkwYWNhMDFkYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwN1QyMjA0MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02OTc0MGI1NGYwYjFhODdkM2IzYTY4NmU3NzM5NmRjOGMwOTYyYmU3NDBlMTVhYWYwYjRmMDUwNzVhM2U0N2FmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.XNn9y5i0-b31MWZfganp31AIQyQDeMYKX9QEOZzTOD8)
After:
![](https://private-user-images.githubusercontent.com/882703/323640403-a235badd-734f-4eb6-880a-3ebe0edc9433.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNjg1NjksIm5iZiI6MTcyMzA2ODI2OSwicGF0aCI6Ii84ODI3MDMvMzIzNjQwNDAzLWEyMzViYWRkLTczNGYtNGViNi04ODBhLTNlYmUwZWRjOTQzMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwN1QyMjA0MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ZGIwYjZjNjRmZWVjM2JjMWExMThmNjBlZmUxY2UyZWVjYzMxMmNiNzYyYjBiNDM0NDI0ZjIzMDM1ZjMxNzE0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.0fwiwrXUOjxakAOcEM5seagIuByNkuNXbKYoGpUWdLc)
Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?