Upgrading source_gen 0.9 to 1
Breaking0.9.10+5 → 1.5.0Breaking5Platform2New6Changed14Fixed10Other1
BreakingUpgrade verdict
5 breaking changes and 2 platform requirement changes.
In plain terms
- Code that catches this error as an Error, or uses the old name, must be updated.
- Code that checked ConstantReader.isAny must be updated because that property no longer exists.
- Code that read ConstantReader.anyValue must be updated because that property no longer exists.
- Code that used LibraryReader.classElements must be updated because that property no longer exists.
Must act Top 5 of 7 that need code or config changes
Dart SDK requirement changed in 1.4.0: >=2.11.999 <3.0.0 → ^3.0.0.
What you must change
Breaking5
Renames
InvalidGenerationSourceError to InvalidGenerationSource and changes it from an Error subtype to an Exception subtype.InvalidGenerationSourceErrorInvalidGenerationSourceErrorExceptionDrops the deprecated ConstantReader.isAny API.
ConstantReader.isAnyDrops the deprecated ConstantReader.anyValue API.
ConstantReader.anyValueDrops the deprecated LibraryReader.classElements API.
LibraryReader.classElementsMigrates the package to null safety.
Platform2
Requires Dart 3.0.
Requires Dart SDK version
2.18.