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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNDA0OTIsIm5iZiI6MTcyMTI0MDE5MiwicGF0aCI6Ii84ODI3MDMvMzIzNjQwMzMyLTVkNjlkOWRkLTA2OGYtNGRlYi04ZGQ2LTE5YzkwYWNhMDFkYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxN1QxODE2MzJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xZDllMDc5NDhlZDY0NDEzZmQyMDk2N2Q0ZWM4NmVhODJiNTIzODgxM2FlNTc2MjQxOTE3NDZhMzU4MTI3ZGZiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.vUR3yn7-KdwhhragsiwLlt-Jvpq_Ubkpj9jnRdgZ7dw)
After:
![](https://private-user-images.githubusercontent.com/882703/323640403-a235badd-734f-4eb6-880a-3ebe0edc9433.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNDA0OTIsIm5iZiI6MTcyMTI0MDE5MiwicGF0aCI6Ii84ODI3MDMvMzIzNjQwNDAzLWEyMzViYWRkLTczNGYtNGViNi04ODBhLTNlYmUwZWRjOTQzMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxN1QxODE2MzJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNzIzMTM2NTJiNTQzNzFlYjIwOGFlZTYyZDVkMGYxOTM1ZjQzMmE2NDMyMDFlNmVlMDEzOTNlZmUzZTZjZWNhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.wqOR5HgaQwW6z0sLAymqCa4KYK66UWcMgEaV0jvsKjI)
Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?