refactor!: Rename (Text) Elements, Nodes and Styles for clarity, add docs #2700
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
This occurred to me after a discussion on the new FCS component PR. As per usual, @spydon has opened my eyes to the ultimate truth:
We should rename loads of files, and it shall affect almost no one.
The idea is to (1) add a "Text" prefix to all text-rendering-related classes and (2) rename the existing
Text*
toInlineText*
(which is what they are).This PR is a bit big, but the changes should hopefully be simple to review, and can be broken down into:
These are all breaking changes but likely won't actually affect most users (see below).
Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
While this is breaking, it should hopefully not affect most users, because these are all infrastructure classes that most people aren't using directly. If you are using the FCS components, or the renderers
TextPaint
orSpriteFontRenderer
directly, this should have zero effect to you.If you are using the Nodes, Stlyes or Elements directly, or have a custom TextRenderer, see below.
Migration instructions
Migrating should be a simple matter of renaming your type references:
Make sure to do it in the appropriate order not to cause any double-replace issues.
If you are importing via the module
package:flame/text.dart
, which we highly encourage, you should not have to change any import statements whatsoever.Related Issues
Relates to #2694