Expose a method to override rendering of the final generated image #165
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.
We prefer the golden_toolkit methodology of setting up golden tests above other packages currently available.
However, probably the number one issue at this point is consistent UI tests across platforms. Even with the Ahem font, these squares do not render consistently accross platforms, due to issues with font smoothing, text scaling differences, etc.
Other packages (such as alchemist) have workarounds for this, like replacing all rendered paragraphs with rendered rectangles instead.
To allow us the best of both worlds, I exposed a new function in the configuration for golden_toolkit which allows providing a method which will run right before the golden tests are generated. This allows developers to (for example) hook-in the rectangle rendering for fonts of the alchemist package (https://github.com/Betterment/alchemist/blob/main/lib/src/blocked_text_image.dart) which will generate consistent golden tests across all platforms, or do more advanced stuff.