fix: add xml 7.x support (#761)#764
Merged
Merged
Conversation
Widen flutter_gen_core's `xml` constraint from `^6.0.0` to `>=6.0.0 <8.0.0`, so projects depending on both flutter_gen and `xml: ^7.0.0` can resolve. Replace the deprecated `XmlNode.text` with `XmlNode.innerText` (present since xml 6.0.0, so compatible with both majors). Add a cross-platform Dart matrix (scripts/test_xml_versions.dart, exposed as `melos test:xml-matrix`) plus a CI step that runs flutter_gen_core's tests against both xml 6.x and 7.x via a temporary dependency_overrides, so neither major regresses. Closes FlutterGen#761
AlexV525
reviewed
Jun 6, 2026
AlexV525
left a comment
Member
There was a problem hiding this comment.
One thing I want to know about API compatibility
| element.getAttribute('name')!, | ||
| // ignore: deprecated_member_use | ||
| element.text, | ||
| element.innerText, |
Member
There was a problem hiding this comment.
Is this a new API introduced in v7? If yes then it's not compatible with v6 then.
Contributor
Author
There was a problem hiding this comment.
No, it appeared earlier. I'll find a proof
Contributor
Author
Contributor
Author
|
@AlexV525 earlier my newly added tests failed (not because of code part - but anyway). Please restart workflow to see actual state |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #764 +/- ##
=======================================
Coverage 97.37% 97.37%
=======================================
Files 24 24
Lines 989 989
=======================================
Hits 963 963
Misses 26 26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AlexV525
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

What does this change?
Fixes #761.
flutter_gen_corepinnedxml: ^6.0.0, so any project dependingon both
flutter_gen/flutter_gen_runnerandxml: ^7.0.0failed versionsolving.
This widens the constraint to
xml: '>=6.0.0 <8.0.0'instead of bumping to^7.0.0, deliberately:while consumers on older toolchains keep working — pub falls back to xml 6.x
automatically. A hard
^7.0.0would instead force everyone onto xml 7,image ≥ 4.9.x, and effectively Dart ≥ 3.11 (xml 7 requiressdk: ^3.11.0),which would also require bumping this package's own
sdkfloor.image4.8.x),so it stays solvable through transitive
image/meta/Flutter-SDK pin shiftsthat a single forced major can't survive.
Also replaces the deprecated
XmlNode.textwithXmlNode.innerText. This iscleanup, not required to build:
XmlNode.textis only deprecated in xml 7.x(deprecated starting from 6.3.0), not removed, and the call was already
// ignore-suppressed.innerTexthas existed since xml 6.0.0, so it'ssource-compatible with both majors and future-proofs against an eventual
removal in xml 8.x.
To guard both majors going forward, adds a cross-platform Dart matrix
(
scripts/test_xml_versions.dart, exposed asmelos test:xml-matrix) that runsflutter_gen_core's tests against both xml 6.x and 7.x via a temporarydependency_overrides, plus a CI step that runs it on every PR.Fixes #761 🎯
Type of change
Checklist:
melos run test)melos run formatto automatically apply formatting)